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

Breadcrumb

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

function ReflectionCaster::castClass

File

vendor/symfony/var-dumper/Caster/ReflectionCaster.php, line 168

Class

ReflectionCaster
Casts Reflector related classes to array representation.

Namespace

Symfony\Component\VarDumper\Caster

Code

public static function castClass(\ReflectionClass $c, array $a, Stub $stub, bool $isNested, int $filter = 0) : array {
    $prefix = Caster::PREFIX_VIRTUAL;
    if ($n = \Reflection::getModifierNames($c->getModifiers())) {
        $a[$prefix . 'modifiers'] = implode(' ', $n);
    }
    self::addMap($a, $c, [
        'extends' => 'getParentClass',
        'implements' => 'getInterfaceNames',
        'constants' => 'getReflectionConstants',
    ]);
    foreach ($c->getProperties() as $n) {
        $a[$prefix . 'properties'][$n->name] = $n;
    }
    foreach ($c->getMethods() as $n) {
        $a[$prefix . 'methods'][$n->name] = $n;
    }
    self::addAttributes($a, $c, $prefix);
    if (!($filter & Caster::EXCLUDE_VERBOSE) && !$isNested) {
        self::addExtra($a, $c);
    }
    return $a;
}

API Navigation

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