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

Breadcrumb

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

function LazyObjectRegistry::getParentMethods

File

vendor/symfony/var-exporter/Internal/LazyObjectRegistry.php, line 103

Class

LazyObjectRegistry
Stores the state of lazy objects and caches related reflection information.

Namespace

Symfony\Component\VarExporter\Internal

Code

public static function getParentMethods($class) {
    $parent = get_parent_class($class);
    $methods = [];
    foreach ([
        'set',
        'isset',
        'unset',
        'clone',
        'serialize',
        'unserialize',
        'sleep',
        'wakeup',
        'destruct',
        'get',
    ] as $method) {
        if (!$parent || !method_exists($parent, '__' . $method)) {
            $methods[$method] = false;
        }
        else {
            $m = new \ReflectionMethod($parent, '__' . $method);
            $methods[$method] = !$m->isAbstract() && !$m->isPrivate();
        }
    }
    $methods['get'] = $methods['get'] ? $m->returnsReference() ? 2 : 1 : 0;
    return $methods;
}

API Navigation

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