bug #24954 [DI] Fix dumping with custom base class (nicolas-grekas)
This PR was merged into the 3.3 branch.
Discussion
----------
[DI] Fix dumping with custom base class
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #24948
| License | MIT
| Doc PR | -
ping @kbond please confirm it's OK for you
Commits
-------
2dd74ab
[DI] Fix dumping with custom base class
This commit is contained in:
commit
772f29fd25
@ -112,7 +112,11 @@ class PhpDumper extends Dumper
|
|||||||
'debug' => true,
|
'debug' => true,
|
||||||
), $options);
|
), $options);
|
||||||
|
|
||||||
$this->initializeMethodNamesMap($options['base_class']);
|
if (0 !== strpos($baseClass = $options['base_class'], '\\') && 'Container' !== $baseClass) {
|
||||||
|
$baseClass = sprintf('%s\%s', $options['namespace'] ? '\\'.$options['namespace'] : '', $baseClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->initializeMethodNamesMap('Container' === $baseClass ? Container::class : $baseClass);
|
||||||
|
|
||||||
$this->docStar = $options['debug'] ? '*' : '';
|
$this->docStar = $options['debug'] ? '*' : '';
|
||||||
|
|
||||||
@ -141,7 +145,7 @@ class PhpDumper extends Dumper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$code = $this->startClass($options['class'], $options['base_class'], $options['namespace']);
|
$code = $this->startClass($options['class'], $baseClass, $options['namespace']);
|
||||||
|
|
||||||
if ($this->container->isCompiled()) {
|
if ($this->container->isCompiled()) {
|
||||||
$code .= $this->addFrozenConstructor();
|
$code .= $this->addFrozenConstructor();
|
||||||
|
@ -16,7 +16,7 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
|
|||||||
*
|
*
|
||||||
* @final since Symfony 3.3
|
* @final since Symfony 3.3
|
||||||
*/
|
*/
|
||||||
class Container extends AbstractContainer
|
class Container extends \Symfony\Component\DependencyInjection\Dump\AbstractContainer
|
||||||
{
|
{
|
||||||
private $parameters;
|
private $parameters;
|
||||||
private $targetDirs = array();
|
private $targetDirs = array();
|
||||||
|
Reference in New Issue
Block a user