Skip to content

[DependencyInjection] Remove deprecated code #15184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 4, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 0 additions & 60 deletions src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
Original file line number Diff line number Diff line change
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