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

Breadcrumb

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

function DsCaster::castCollection

File

vendor/symfony/var-dumper/Caster/DsCaster.php, line 28

Class

DsCaster
Casts Ds extension classes to array representation.

Namespace

Symfony\Component\VarDumper\Caster

Code

public static function castCollection(Collection $c, array $a, Stub $stub, bool $isNested) : array {
    $a[Caster::PREFIX_VIRTUAL . 'count'] = $c->count();
    $a[Caster::PREFIX_VIRTUAL . 'capacity'] = $c->capacity();
    if (!$c instanceof Map) {
        $a += $c->toArray();
    }
    return $a;
}

API Navigation

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