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

Breadcrumb

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

function SplCaster::castObjectStorage

File

vendor/symfony/var-dumper/Caster/SplCaster.php, line 179

Class

SplCaster
Casts SPL related classes to array representation.

Namespace

Symfony\Component\VarDumper\Caster

Code

public static function castObjectStorage(\SplObjectStorage $c, array $a, Stub $stub, bool $isNested) : array {
    $storage = [];
    unset($a[Caster::PREFIX_DYNAMIC . "\x00gcdata"]);
    // Don't hit https://bugs.php.net/65967
    unset($a["\x00SplObjectStorage\x00storage"]);
    $clone = clone $c;
    foreach ($clone as $obj) {
        $storage[] = new EnumStub([
            'object' => $obj,
            'info' => $clone->getInfo(),
        ]);
    }
    $a += [
        Caster::PREFIX_VIRTUAL . 'storage' => $storage,
    ];
    return $a;
}

API Navigation

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