function AmqpCaster::castExchange
File
-
vendor/
symfony/ var-dumper/ Caster/ AmqpCaster.php, line 128
Class
- AmqpCaster
- Casts Amqp related classes to array representation.
Namespace
Symfony\Component\VarDumper\CasterCode
public static function castExchange(\AMQPExchange $c, array $a, Stub $stub, bool $isNested) : array {
$prefix = Caster::PREFIX_VIRTUAL;
$a += [
$prefix . 'flags' => self::extractFlags($c->getFlags()),
];
$type = isset(self::EXCHANGE_TYPES[$c->getType()]) ? new ConstStub(self::EXCHANGE_TYPES[$c->getType()], $c->getType()) : $c->getType();
// Recent version of the extension already expose private properties
if (isset($a["\x00AMQPExchange\x00name"])) {
$a["\x00AMQPExchange\x00type"] = $type;
return $a;
}
$a += [
$prefix . 'connection' => $c->getConnection(),
$prefix . 'channel' => $c->getChannel(),
$prefix . 'name' => $c->getName(),
$prefix . 'type' => $type,
$prefix . 'arguments' => $c->getArguments(),
];
return $a;
}