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

Breadcrumb

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

function PhpDumper::isSingleUsePrivateNode

1 call to PhpDumper::isSingleUsePrivateNode()
PhpDumper::analyzeReferences in vendor/symfony/dependency-injection/Dumper/PhpDumper.php

File

vendor/symfony/dependency-injection/Dumper/PhpDumper.php, line 2187

Class

PhpDumper
PhpDumper dumps a service container as a PHP class.

Namespace

Symfony\Component\DependencyInjection\Dumper

Code

private function isSingleUsePrivateNode(ServiceReferenceGraphNode $node) : bool {
    if ($node->getValue()
        ->isPublic()) {
        return false;
    }
    $ids = [];
    foreach ($node->getInEdges() as $edge) {
        if (!($value = $edge->getSourceNode()
            ->getValue())) {
            continue;
        }
        if ($edge->isLazy() || !$value instanceof Definition || !$value->isShared()) {
            return false;
        }
        $ids[$edge->getSourceNode()
            ->getId()] = true;
    }
    return 1 === \count($ids);
}
RSS feed
Powered by Drupal