-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[VarDumper] Improve dump of AMQP* Object #21557
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
Conversation
shouldn't we rather avoid all the useless info instead of overwriting the existing ones ? |
The things is: it's hard to know when property X or property Y has been added in the extension. So If we want to avoid overwriting, we should check for each property if it has been defined before. WDYT? |
Well, you are switching the prefix globally anyway, which implies that they all changed together. |
Indeed. But anyway But just to be sure I understand, you propose something like that: // Recent version of the extension already expose internal properties
if (isset($a["\x00AMQPConnection\x00login"])) {
$a += [
Caster::PREFIX_VIRTUAL.'isConnected' => $c->isConnected(),
];
return $a;
}
$prefix = Caster::PREFIX_VIRTUAL;
// BC layer in the amqp lib
if (method_exists($c, 'getReadTimeout')) {
$timeout = $c->getReadTimeout();
} else {
$timeout = $c->getTimeout();
}
$a += array(
$prefix.'isConnected' => $c->isConnected(),
$prefix.'login' => $c->getLogin(),
$prefix.'password' => $c->getPassword(),
$prefix.'host' => $c->getHost(),
$prefix.'vhost' => $c->getVhost(),
$prefix.'port' => $c->getPort(),
$prefix.'read_timeout' => $timeout,
);
return $a; |
@stof I updated my PR according to your comments. |
The release of https://github.com/pdezwart/php-amqp/ 1.7.0alpha1 changed internally the handlings of AMQP* object. So now when dumping using var_dump(), many information are availables. So many information are displayed twice. This commit fixes this issue and keeps displaying basic information for older version of the lib. Reference: * https://pecl.php.net/package-info.php?package=amqp&version=1.7.0alpha1 * php-amqp/php-amqp@314afbc (and next commits)
👍 Btw, don't we need to update some tests ? |
This part is not tested... :/ |
Thank you @lyrixx. |
This PR was merged into the 2.8 branch. Discussion ---------- [VarDumper] Improve dump of AMQP* Object | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - --- The release of https://github.com/pdezwart/php-amqp/ 1.7.0alpha1 changed internally the handling of AMQP* object. So now when dumping using var_dump(), many information are available. So many information are displayed twice. This commit fixes this issue and keeps displaying basic information for older versions of the lib. Reference: * https://pecl.php.net/package-info.php?package=amqp&version=1.7.0alpha1 * php-amqp/php-amqp@314afbc (and next commits) ---   Commits ------- c553352 [VarDumper] Improve dump of AMQP* Object
The release of https://github.com/pdezwart/php-amqp/ 1.7.0alpha1
changed internally the handling of AMQP* object. So now when dumping
using var_dump(), many information are available. So many information
are displayed twice. This commit fixes this issue and keeps displaying basic
information for older versions of the lib.
Reference: