function OptimizedPhpArrayDumper::getServiceClosureCall

Same name in other branches
  1. 11.x core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper::getServiceClosureCall()

Gets a service closure reference in a suitable PHP array format.

Parameters

string $id: The ID of the service to get a reference for.

int $invalid_behavior: (optional) The invalid behavior of the service.

Return value

string|object A suitable representation of the service closure reference.

1 call to OptimizedPhpArrayDumper::getServiceClosureCall()
OptimizedPhpArrayDumper::dumpValue in core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php
Dumps the value to PHP array format.

File

core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php, line 550

Class

OptimizedPhpArrayDumper
OptimizedPhpArrayDumper dumps a service container as a serialized PHP array.

Namespace

Drupal\Component\DependencyInjection\Dumper

Code

protected function getServiceClosureCall(string $id, int $invalid_behavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) {
    return (object) [
        'type' => 'service_closure',
        'id' => $id,
        'invalidBehavior' => $invalid_behavior,
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.