class PhpArrayDumper in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Component/DependencyInjection/Dumper/PhpArrayDumper.php \Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper
- 9 core/lib/Drupal/Component/DependencyInjection/Dumper/PhpArrayDumper.php \Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper
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.
Hierarchy
- class \Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper extends \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper
Expanded class hierarchy of PhpArrayDumper
See also
\Drupal\Component\DependencyInjection\PhpArrayContainer
File
- core/
lib/ Drupal/ Component/ DependencyInjection/ Dumper/ PhpArrayDumper.php, line 19
Namespace
Drupal\Component\DependencyInjection\DumperView source
class PhpArrayDumper extends OptimizedPhpArrayDumper {
/**
* {@inheritdoc}
*/
public function getArray() {
$this->serialize = FALSE;
return parent::getArray();
}
/**
* {@inheritdoc}
*/
protected function dumpCollection($collection, &$resolve = FALSE) {
$code = [];
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;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PhpArrayDumper:: |
protected | function | ||
PhpArrayDumper:: |
public | function | ||
PhpArrayDumper:: |
protected | function | ||
PhpArrayDumper:: |
protected | function | ||
PhpArrayDumper:: |
protected | function |