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

Breadcrumb

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

function 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 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 276

Class

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

Namespace

Drupal\Component\DependencyInjection\Dumper

Code

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