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

Breadcrumb

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

function AutowireRequiredMethodsPass::isWither

1 call to AutowireRequiredMethodsPass::isWither()
AutowireRequiredMethodsPass::processValue in vendor/symfony/dependency-injection/Compiler/AutowireRequiredMethodsPass.php
Processes a value found in a definition tree.

File

vendor/symfony/dependency-injection/Compiler/AutowireRequiredMethodsPass.php, line 80

Class

AutowireRequiredMethodsPass
Looks for definitions with autowiring enabled and registers their corresponding "#[Required]" methods as setters.

Namespace

Symfony\Component\DependencyInjection\Compiler

Code

private function isWither(\ReflectionMethod $reflectionMethod, string $doc) : bool {
    $match = preg_match('#(?:^/\\*\\*|\\n\\s*+\\*)\\s*+@return\\s++(static|\\$this)[\\s\\*]#i', $doc, $matches);
    if ($match && 'static' === $matches[1]) {
        return true;
    }
    if ($match && '$this' === $matches[1]) {
        return false;
    }
    $reflectionType = $reflectionMethod->hasReturnType() ? $reflectionMethod->getReturnType() : null;
    return $reflectionType instanceof \ReflectionNamedType && 'static' === $reflectionType->getName();
}

API Navigation

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