3 namespace Drupal\Component\DependencyInjection\Dumper;
5 use Symfony\Component\DependencyInjection\ContainerInterface;
8 * PhpArrayDumper dumps a service container as a PHP array.
10 * The format of this dumper is a human-readable serialized PHP array, which is
11 * very similar to the YAML based format, but based on PHP arrays instead of
14 * It is human-readable, for a machine-optimized version based on this one see
15 * \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper.
17 * @see \Drupal\Component\DependencyInjection\PhpArrayContainer
19 class PhpArrayDumper extends OptimizedPhpArrayDumper {
24 public function getArray() {
25 $this->serialize = FALSE;
26 return parent::getArray();
32 protected function dumpCollection($collection, &$resolve = FALSE) {
35 foreach ($collection as $key => $value) {
36 if (is_array($value)) {
37 $code[$key] = $this->dumpCollection($value);
40 $code[$key] = $this->dumpValue($value);
50 protected function getServiceCall($id, $invalid_behavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) {
51 if ($invalid_behavior !== ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) {
61 protected function getParameterCall($name) {
62 return '%' . $name . '%';
68 protected function supportsMachineFormat() {