Skip to content

Commit

Permalink
minor #15184 [DependencyInjection] Remove deprecated code (dosten)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.0-dev branch.

Discussion
----------

[DependencyInjection] Remove deprecated code

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

This code has been removed in #14155 but seems that a wrong merge didn't removed it.

Commits
-------

f2fef91 Removed deprecated code
  • Loading branch information
fabpot committed Jul 4, 2015
2 parents 8279d11 + f2fef91 commit 5d4368a
Showing 1 changed file with 0 additions and 60 deletions.
60 changes: 0 additions & 60 deletions src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
Expand Up @@ -25,7 +25,6 @@
use Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\NullDumper;
use Symfony\Component\DependencyInjection\ExpressionLanguage;
use Symfony\Component\ExpressionLanguage\Expression;
use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface;

/**
* PhpDumper dumps a service container as a PHP class.
Expand Down Expand Up @@ -677,65 +676,6 @@ private function addServices()
return $publicServices.$privateServices;
}

/**
* Adds synchronizer methods.
*
* @param string $id A service identifier
* @param Definition $definition A Definition instance
*
* @return string|null
*
* @deprecated since version 2.7, will be removed in 3.0.
*/
private function addServiceSynchronizer($id, Definition $definition)
{
if (!$definition->isSynchronized(false)) {
return;
}

if ('request' !== $id) {
@trigger_error('Synchronized services were deprecated in version 2.7 and won\'t work anymore in 3.0.', E_USER_DEPRECATED);
}

$code = '';
foreach ($this->container->getDefinitions() as $definitionId => $definition) {
foreach ($definition->getMethodCalls() as $call) {
foreach ($call[1] as $argument) {
if ($argument instanceof Reference && $id == (string) $argument) {
$arguments = array();
foreach ($call[1] as $value) {
$arguments[] = $this->dumpValue($value);
}

$call = $this->wrapServiceConditionals($call[1], sprintf("\$this->get('%s')->%s(%s);", $definitionId, $call[0], implode(', ', $arguments)));

$code .= <<<EOF
if (\$this->initialized('$definitionId')) {
$call
}
EOF;
}
}
}
}

if (!$code) {
return;
}

return <<<EOF
/**
* Updates the '$id' service.
*/
protected function synchronize{$this->camelize($id)}Service()
{
$code }
EOF;
}

private function addNewInstance($id, Definition $definition, $return, $instantiation)
{
$class = $this->dumpValue($definition->getClass());
Expand Down

0 comments on commit 5d4368a

Please sign in to comment.