You are here

protected function OptimizedPhpArrayDumper::dumpMethodCalls in Service Container 7

Same name and namespace in other branches
  1. 7.2 lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper::dumpMethodCalls()

Dumps method calls to a PHP array.

Parameters

array $calls: An array of method calls.

Return value

array The PHP array representation of the method calls.

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

File

lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php, line 279
Contains \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper.

Class

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

Namespace

Drupal\Component\DependencyInjection\Dumper

Code

protected function dumpMethodCalls(array $calls) {
  $code = array();
  foreach ($calls as $key => $call) {
    $method = $call[0];
    $arguments = array();
    if (!empty($call[1])) {
      $arguments = $this
        ->dumpCollection($call[1]);
    }
    $code[$key] = array(
      $method,
      $arguments,
    );
  }
  return $code;
}