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

Breadcrumb

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

function StaticReflectionParser::getParentParser

If the current class extends another, get the parser for the latter.

Parameters

\Drupal\Component\Annotation\Doctrine\StaticReflectionParser $parser: The current static parser.

$finder: The class finder. Must implement \Drupal\Component\ClassFinder\ClassFinderInterface, but can do so implicitly (i.e., implements the interface's methods but not the actual interface).

Return value

static|null The static parser for the parent if there's a parent class or NULL.

1 call to StaticReflectionParser::getParentParser()
AnnotatedClassDiscoveryAutomatedProviders::prepareAnnotationDefinition in core/modules/migrate/src/Plugin/Discovery/AnnotatedClassDiscoveryAutomatedProviders.php
Prepares the annotation definition.

File

core/modules/migrate/src/Plugin/Discovery/StaticReflectionParser.php, line 31

Class

StaticReflectionParser
Allows getting the reflection parser for the parent class.

Namespace

Drupal\migrate\Plugin\Discovery

Code

public static function getParentParser(BaseStaticReflectionParser $parser, $finder) {
    // Ensure the class has been parsed before accessing the parentClassName
    // property.
    $parser->parse();
    if ($parser->parentClassName) {
        return new static($parser->parentClassName, $finder, $parser->classAnnotationOptimize);
    }
}

API Navigation

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