Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for setting client properties #150

Merged
merged 2 commits into from
May 20, 2024

Conversation

jeromegamez
Copy link
Contributor

@jeromegamez jeromegamez commented May 19, 2024

As a follow-up to #132 , this PR adds support for setting client properties and capabilities, as described in

$connection = [
    'host'              => 'HOSTNAME',
    'vhost'             => 'VHOST',    // The default vhost is /
    'user'              => 'USERNAME', // The default user is guest
    'password'          => 'PASSWORD', // The default password is guest
    'client_properties' => [
        'connection_name' => 'It works!',
    ],
];
Without connection name With connection name
without_connection_name with_connection_name

:octocat:

@jeromegamez
Copy link
Contributor Author

@WyriHaximus I was thinking about using

$options['client_properties'] ??= [];

instead of

if (!isset($options['client_properties'])) {
    $options['client_properties'] = [];
}

That would be inconsistent with the other checks, though. Is this something I could/should propose in a separate PR?

@WyriHaximus WyriHaximus added this to the v0.6.0 milestone May 20, 2024
@WyriHaximus WyriHaximus self-requested a review May 20, 2024 05:50
@WyriHaximus
Copy link
Collaborator

@WyriHaximus I was thinking about using

$options['client_properties'] ??= [];

instead of

if (!isset($options['client_properties'])) {
    $options['client_properties'] = [];
}

That would be inconsistent with the other checks, though. Is this something I could/should propose in a separate PR?

Yes please, I want to make it pass PHPStan at max level before release 0.6 so all these small improvements would greatly help cleaning up the code 👍

Copy link
Collaborator

@WyriHaximus WyriHaximus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for also filing this on the 0.6 branch 👍

@WyriHaximus WyriHaximus merged commit 873ec47 into jakubkulhan:0.6.x May 20, 2024
56 checks passed
@jeromegamez jeromegamez deleted the client-properties-support branch May 20, 2024 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants