Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
5 / 5 |
CRAP | |
100.00% |
13 / 13 |
PhpArrayDumper | |
100.00% |
1 / 1 |
|
100.00% |
5 / 5 |
8 | |
100.00% |
13 / 13 |
getArray | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
dumpCollection | |
100.00% |
1 / 1 |
3 | |
100.00% |
6 / 6 |
|||
getServiceCall | |
100.00% |
1 / 1 |
2 | |
100.00% |
3 / 3 |
|||
getParameterCall | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
supportsMachineFormat | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
<?php | |
/** | |
* @file | |
* Contains \Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper. | |
*/ | |
namespace Drupal\Component\DependencyInjection\Dumper; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
/** | |
* PhpArrayDumper dumps a service container as a PHP array. | |
* | |
* The format of this dumper is a human-readable serialized PHP array, which is | |
* very similar to the YAML based format, but based on PHP arrays instead of | |
* YAML strings. | |
* | |
* It is human-readable, for a machine-optimized version based on this one see | |
* \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper. | |
* | |
* @see \Drupal\Component\DependencyInjection\PhpArrayContainer | |
*/ | |
class PhpArrayDumper extends OptimizedPhpArrayDumper { | |
/** | |
* {@inheritdoc} | |
*/ | |
public function getArray() { | |
$this->serialize = FALSE; | |
return parent::getArray(); | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
protected function dumpCollection($collection, &$resolve = FALSE) { | |
$code = array(); | |
foreach ($collection as $key => $value) { | |
if (is_array($value)) { | |
$code[$key] = $this->dumpCollection($value); | |
} | |
else { | |
$code[$key] = $this->dumpValue($value); | |
} | |
} | |
return $code; | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
protected function getServiceCall($id, $invalid_behavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) { | |
if ($invalid_behavior !== ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) { | |
return '@?' . $id; | |
} | |
return '@' . $id; | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
protected function getParameterCall($name) { | |
return '%' . $name . '%'; | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
protected function supportsMachineFormat() { | |
return FALSE; | |
} | |
} |