function OptimizedPhpArrayDumper::dumpCallable

Same name in other branches
  1. 8.9.x core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper::dumpCallable()
  2. 10 core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper::dumpCallable()
  3. 11.x core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper::dumpCallable()

Dumps callable to a PHP array.

Parameters

array|callable $callable: The callable to process.

Return value

callable The processed callable.

1 call to OptimizedPhpArrayDumper::dumpCallable()
OptimizedPhpArrayDumper::getServiceDefinition in core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php
Gets a service definition as PHP array.

File

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

Class

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

Namespace

Drupal\Component\DependencyInjection\Dumper

Code

protected function dumpCallable($callable) {
    if (is_array($callable)) {
        $callable[0] = $this->dumpValue($callable[0]);
        $callable = [
            $callable[0],
            $callable[1],
        ];
    }
    return $callable;
}

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