Skip to content

Commit

Permalink
ContainerBuilder: object ContainerBuilder in Statement is not longer …
Browse files Browse the repository at this point in the history
…alias for `@container` (BC break)
  • Loading branch information
dg committed May 10, 2016
1 parent 7985583 commit 9fbd1d4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions src/DI/ContainerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -784,9 +784,6 @@ public function formatPhp($statement, $args)
if ($val instanceof Statement) {
$val = self::literal($this->formatStatement($val));

} elseif ($val === $this) {
$val = self::literal('$this');

} elseif ($val instanceof ServiceDefinition) {
$val = '@' . current(array_keys($this->getDefinitions(), $val, TRUE));
}
Expand Down Expand Up @@ -852,9 +849,6 @@ public function normalizeEntity($entity)

} elseif ($entity instanceof ServiceDefinition) { // ServiceDefinition -> @serviceName
$entity = '@' . current(array_keys($this->definitions, $entity, TRUE));

} elseif (is_array($entity) && $entity[0] === $this) { // [$this, ...] -> [@container, ...]
$entity[0] = '@' . self::THIS_CONTAINER;
}
return $entity; // Class, @service, [Class, member], [@service, member], [, globalFunc], Statement
}
Expand Down
2 changes: 1 addition & 1 deletion tests/DI/ContainerBuilder.basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ $six = $builder->addDefinition('six')
->addSetup(['@six', 'methodA'], ['a', 'b']);

$builder->addDefinition('seven')
->setFactory([$six, 'create'], [$builder, $six])
->setFactory([$six, 'create'], ['@container', $six])
->addSetup([$six, 'methodA'])
->addSetup('$service->methodA(?)', ['a']);

Expand Down

0 comments on commit 9fbd1d4

Please sign in to comment.