Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AmqpCaster.php

function AmqpCaster::castConnection

File

vendor/symfony/var-dumper/Caster/AmqpCaster.php, line 49

Class

AmqpCaster
Casts Amqp related classes to array representation.

Namespace

Symfony\Component\VarDumper\Caster

Code

public static function castConnection(\AMQPConnection $c, array $a, Stub $stub, bool $isNested) : array {
    $prefix = Caster::PREFIX_VIRTUAL;
    $a += [
        $prefix . 'is_connected' => $c->isConnected(),
    ];
    // Recent version of the extension already expose private properties
    if (isset($a["\x00AMQPConnection\x00login"])) {
        return $a;
    }
    // BC layer in the amqp lib
    if (method_exists($c, 'getReadTimeout')) {
        $timeout = $c->getReadTimeout();
    }
    else {
        $timeout = $c->getTimeout();
    }
    $a += [
        $prefix . 'is_connected' => $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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal