class PhpArrayDumper in Service Container 7
Same name in this branch
- 7 lib/Drupal/Core/DependencyInjection/Dumper/PhpArrayDumper.php \Drupal\Core\DependencyInjection\Dumper\PhpArrayDumper
- 7 lib/Drupal/Component/DependencyInjection/Dumper/PhpArrayDumper.php \Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper
Same name and namespace in other branches
- 7.2 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 \Symfony\Component\DependencyInjection\Dumper\Dumper implements DumperInterface
- class \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper
- class \Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper
- class \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper
Expanded class hierarchy of PhpArrayDumper
See also
\Drupal\Component\DependencyInjection\PhpArrayContainer
2 files declare their use of PhpArrayDumper
- PhpArrayDumperTest.php in tests/
src/ DependencyInjection/ Dumper/ PhpArrayDumperTest.php - Contains \Drupal\Tests\service_container\DependencyInjection\Dumper\PhpArrayDumperTest
- ServiceContainerSymfonyServiceProvider.php in modules/
providers/ service_container_symfony/ src/ ServiceContainer/ ServiceProvider/ ServiceContainerSymfonyServiceProvider.php - Contains \Drupal\service_container_symfony\ServiceContainer\ServiceProvider\ServiceContainerSymfonyServiceProvider
File
- lib/
Drupal/ Component/ DependencyInjection/ Dumper/ PhpArrayDumper.php, line 24 - Contains \Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper.
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 = 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;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Dumper:: |
protected | property | ||
Dumper:: |
public | function | Constructor. | 1 |
OptimizedPhpArrayDumper:: |
protected | property | Whether to serialize service definitions or not. | |
OptimizedPhpArrayDumper:: |
public | function |
Dumps the service container. Overrides DumperInterface:: |
|
OptimizedPhpArrayDumper:: |
protected | function | Dumps callable to a PHP array. | |
OptimizedPhpArrayDumper:: |
protected | function | Dumps method calls to a PHP array. | |
OptimizedPhpArrayDumper:: |
protected | function | Dumps the value to PHP array format. | |
OptimizedPhpArrayDumper:: |
protected | function | Escapes parameters. | |
OptimizedPhpArrayDumper:: |
protected | function | Gets the aliases as a PHP array. | |
OptimizedPhpArrayDumper:: |
protected | function | Gets parameters of the container as a PHP array. | |
OptimizedPhpArrayDumper:: |
protected | function | Gets a private service definition in a suitable format. | |
OptimizedPhpArrayDumper:: |
protected | function | Gets a service reference for a reference in a suitable PHP array format. | |
OptimizedPhpArrayDumper:: |
protected | function | Gets a service definition as PHP array. | |
OptimizedPhpArrayDumper:: |
protected | function | Gets services of the container as a PHP array. | |
OptimizedPhpArrayDumper:: |
protected | function | Prepares parameters for the PHP array dumping. | |
PhpArrayDumper:: |
protected | function |
Dumps a collection to a PHP array. Overrides OptimizedPhpArrayDumper:: |
|
PhpArrayDumper:: |
public | function |
Gets the service container definition as a PHP array. Overrides OptimizedPhpArrayDumper:: |
|
PhpArrayDumper:: |
protected | function |
Gets a parameter reference in a suitable PHP array format. Overrides OptimizedPhpArrayDumper:: |
|
PhpArrayDumper:: |
protected | function |
Gets a service reference for an ID in a suitable PHP array format. Overrides OptimizedPhpArrayDumper:: |
|
PhpArrayDumper:: |
protected | function |
Whether this supports the machine-optimized format or not. Overrides OptimizedPhpArrayDumper:: |