Permalink
Browse files

minor #24426 [DI] remove inheritdoc from dumped container (Tobion)

This PR was merged into the 3.4 branch.

Discussion
----------

[DI] remove inheritdoc from dumped container

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

The inheritdoc without adding text is pointless on it's own as any decent IDE will show that those methods are overwriting the base method. This removes it from the dumped container to remove memory and generation time. This goes in the same direction as #23673, #18048 and #24342
It does not affect phpdocs of the compiled container that might actually be useful (factory methods of services explaining if the service is private, shared etc.).

Commits
-------

d779845 [DI] remove inheritdoc from dumped container
  • Loading branch information...
fabpot committed Oct 4, 2017
2 parents 2abe788 + d779845 commit 8b7b902bc1270f136aad6c2fbfc688a49a364b54
Showing with 0 additions and 336 deletions.
  1. +0 −27 src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
  2. +0 −9 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php
  3. +0 −9 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php
  4. +0 −21 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php
  5. +0 −21 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services12.php
  6. +0 −9 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services13.php
  7. +0 −9 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services19.php
  8. +0 −9 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services24.php
  9. +0 −21 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services26.php
  10. +0 −9 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services31.php
  11. +0 −9 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services33.php
  12. +0 −21 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php
  13. +0 −24 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_as_files.txt
  14. +0 −21 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php
  15. +0 −21 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_array_params.php
  16. +0 −21 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_base64_env.php
  17. +0 −9 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_legacy_privates.php
  18. +0 −9 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_locator.php
  19. +0 −9 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_private_frozen.php
  20. +0 −9 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_private_in_expression.php
  21. +0 −21 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_rot13_env.php
  22. +0 −9 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_subscriber.php
  23. +0 −9 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_uninitialized_ref.php
@@ -899,25 +899,16 @@ public function __construct()
if ($this->container->isCompiled()) {
$code .= <<<EOF
/*{$this->docStar}
* {@inheritdoc}
*/
public function compile()
{
throw new LogicException('You cannot compile a dumped container that was already compiled.');
}
/*{$this->docStar}
* {@inheritdoc}
*/
public function isCompiled()
{
return true;
}
/*{$this->docStar}
* {@inheritdoc}
*/
public function isFrozen()
{
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Use the isCompiled() method instead.', __METHOD__), E_USER_DEPRECATED);
@@ -931,9 +922,6 @@ public function isFrozen()
if ($this->asFiles) {
$code .= <<<EOF
/*{$this->docStar}
* {@inheritdoc}
*/
protected function load(\$file, \$lazyLoad = true)
{
return require \$file;
@@ -1125,9 +1113,6 @@ private function addDefaultParametersMethod()
if ($this->container->isCompiled()) {
$code .= <<<'EOF'
/**
* {@inheritdoc}
*/
public function getParameter($name)
{
if (!(isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters))) {
@@ -1144,27 +1129,18 @@ public function getParameter($name)
return $this->parameters[$name];
}
/**
* {@inheritdoc}
*/
public function hasParameter($name)
{
$name = $this->normalizeParameterName($name);
return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters);
}
/**
* {@inheritdoc}
*/
public function setParameter($name, $value)
{
throw new LogicException('Impossible to call set() on a frozen ParameterBag.');
}
/**
* {@inheritdoc}
*/
public function getParameterBag()
{
if (null === $this->parameterBag) {
@@ -1179,9 +1155,6 @@ public function getParameterBag()
}
EOF;
if ('' === $this->docStar) {
$code = str_replace('/**', '/*', $code);
}
if ($dynamicPhp) {
$loadedDynamicParameters = $this->exportParameters(array_combine(array_keys($dynamicPhp), array_fill(0, count($dynamicPhp), false)), '', 8);
@@ -28,25 +28,16 @@ public function __construct()
$this->aliases = array();
}
/**
* {@inheritdoc}
*/
public function compile()
{
throw new LogicException('You cannot compile a dumped container that was already compiled.');
}
/**
* {@inheritdoc}
*/
public function isCompiled()
{
return true;
}
/**
* {@inheritdoc}
*/
public function isFrozen()
{
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Use the isCompiled() method instead.', __METHOD__), E_USER_DEPRECATED);
@@ -26,25 +26,16 @@ public function __construct()
$this->aliases = array();
}
/**
* {@inheritdoc}
*/
public function compile()
{
throw new LogicException('You cannot compile a dumped container that was already compiled.');
}
/**
* {@inheritdoc}
*/
public function isCompiled()
{
return true;
}
/**
* {@inheritdoc}
*/
public function isFrozen()
{
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Use the isCompiled() method instead.', __METHOD__), E_USER_DEPRECATED);
@@ -31,25 +31,16 @@ public function __construct()
$this->aliases = array();
}
/**
* {@inheritdoc}
*/
public function compile()
{
throw new LogicException('You cannot compile a dumped container that was already compiled.');
}
/**
* {@inheritdoc}
*/
public function isCompiled()
{
return true;
}
/**
* {@inheritdoc}
*/
public function isFrozen()
{
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Use the isCompiled() method instead.', __METHOD__), E_USER_DEPRECATED);
@@ -67,9 +58,6 @@ protected function getTestService()
return $this->services['test'] = new \stdClass(array('only dot' => '.', 'concatenation as value' => '.\'\'.', 'concatenation from the start value' => '\'\'.', '.' => 'dot as a key', '.\'\'.' => 'concatenation as a key', '\'\'.' => 'concatenation from the start key', 'optimize concatenation' => 'string1-string2', 'optimize concatenation with empty string' => 'string1string2', 'optimize concatenation from the start' => 'start', 'optimize concatenation at the end' => 'end'));
}
/**
* {@inheritdoc}
*/
public function getParameter($name)
{
if (!(isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters))) {
@@ -86,27 +74,18 @@ public function getParameter($name)
return $this->parameters[$name];
}
/**
* {@inheritdoc}
*/
public function hasParameter($name)
{
$name = $this->normalizeParameterName($name);
return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters);
}
/**
* {@inheritdoc}
*/
public function setParameter($name, $value)
{
throw new LogicException('Impossible to call set() on a frozen ParameterBag.');
}
/**
* {@inheritdoc}
*/
public function getParameterBag()
{
if (null === $this->parameterBag) {
@@ -35,25 +35,16 @@ public function __construct()
$this->aliases = array();
}
/**
* {@inheritdoc}
*/
public function compile()
{
throw new LogicException('You cannot compile a dumped container that was already compiled.');
}
/**
* {@inheritdoc}
*/
public function isCompiled()
{
return true;
}
/**
* {@inheritdoc}
*/
public function isFrozen()
{
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Use the isCompiled() method instead.', __METHOD__), E_USER_DEPRECATED);
@@ -71,9 +62,6 @@ protected function getTestService()
return $this->services['test'] = new \stdClass(('wiz'.$this->targetDirs[1]), array(('wiz'.$this->targetDirs[1]) => ($this->targetDirs[2].'/')));
}
/**
* {@inheritdoc}
*/
public function getParameter($name)
{
if (!(isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters))) {
@@ -90,27 +78,18 @@ public function getParameter($name)
return $this->parameters[$name];
}
/**
* {@inheritdoc}
*/
public function hasParameter($name)
{
$name = $this->normalizeParameterName($name);
return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters);
}
/**
* {@inheritdoc}
*/
public function setParameter($name, $value)
{
throw new LogicException('Impossible to call set() on a frozen ParameterBag.');
}
/**
* {@inheritdoc}
*/
public function getParameterBag()
{
if (null === $this->parameterBag) {
@@ -29,25 +29,16 @@ public function __construct()
$this->aliases = array();
}
/**
* {@inheritdoc}
*/
public function compile()
{
throw new LogicException('You cannot compile a dumped container that was already compiled.');
}
/**
* {@inheritdoc}
*/
public function isCompiled()
{
return true;
}
/**
* {@inheritdoc}
*/
public function isFrozen()
{
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Use the isCompiled() method instead.', __METHOD__), E_USER_DEPRECATED);
@@ -30,25 +30,16 @@ public function __construct()
$this->aliases = array();
}
/**
* {@inheritdoc}
*/
public function compile()
{
throw new LogicException('You cannot compile a dumped container that was already compiled.');
}
/**
* {@inheritdoc}
*/
public function isCompiled()
{
return true;
}
/**
* {@inheritdoc}
*/
public function isFrozen()
{
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Use the isCompiled() method instead.', __METHOD__), E_USER_DEPRECATED);
@@ -29,25 +29,16 @@ public function __construct()
$this->aliases = array();
}
/**
* {@inheritdoc}
*/
public function compile()
{
throw new LogicException('You cannot compile a dumped container that was already compiled.');
}
/**
* {@inheritdoc}
*/
public function isCompiled()
{
return true;
}
/**
* {@inheritdoc}
*/
public function isFrozen()
{
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Use the isCompiled() method instead.', __METHOD__), E_USER_DEPRECATED);
Oops, something went wrong.

0 comments on commit 8b7b902

Please sign in to comment.