10000 minor #15694 [2.8] Deprecate IntrospectableContainerInterface (nicola… · symfony/symfony@d5c046d · GitHub
[go: up one dir, main page]

Skip to content

Commit d5c046d

Browse files
committed
minor #15694 [2.8] Deprecate IntrospectableContainerInterface (nicolas-grekas)
This PR was merged into the 2.8 branch. Discussion ---------- [2.8] Deprecate IntrospectableContainerInterface | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Patch on Security is required for tests compat with 3.0, see #15684 IntrospectableContainerInterface is already deprecated in master. Commits ------- c2b94a1 [2.8] Cleanup
2 parents daaf7e8 + c2b94a1 commit d5c046d

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,13 @@ public function getProxyFactoryCode(Definition $definition, $id)
6868
{
6969
$instantiation = 'return';
7070

71-
if ($definition->isShared() && ContainerInterface::SCOPE_CONTAINER === $definition->getScope(false)) {
71+
if ($definition->isShared()) {
7272
$instantiation .= " \$this->services['$id'] =";
73-
} elseif ($definition->isShared() && ContainerInterface::SCOPE_PROTOTYPE !== $scope = $definition->getScope(false)) {
74-
$instantiation .= " \$this->services['$id'] = \$this->scopedServices['$scope']['$id'] =";
75-
}
73+
74+
if (defined('Symfony\Component\DependencyInjection\ContainerInterface::SCOPE_CONTAINER') && ContainerInterface::SCOPE_CONTAINER !== $scope = $definition->getScope(false)) {
75+
$instantiation .= " \$this->scopedServices['$scope']['$id'] =";
76+
}
77+
}
7678

7779
$methodName = 'get'.Container::camelize($id).'Service';
7880
$proxyClass = $this->getProxyClassName($definition);

src/Symfony/Bundle/SecurityBundle/composer.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
"symfony/config": "~2.8|~3.0.0",
2828
"symfony/console": "~2.7|~3.0.0",
2929
"symfony/css-selector": "~2.0,>=2.0.5|~3.0.0",
30-
"symfony/dependency-injection": "~2.6,>=2.6.6|~3.0.0",
3130
"symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0",
32-
"symfony/form": "~2.8",
3331
"symfony/framework-bundle": "~2.8",
3432
"symfony/http-foundation": "~2.4|~3.0.0",
3533
"symfony/twig-bundle": "~2.7|~3.0.0",

src/Symfony/Component/DependencyInjection/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ CHANGELOG
44
2.8.0
55
-----
66

7+
* deprecated IntrospectableContainerInterface, to be merged with ContainerInterface in 3.0
78
* allowed specifying a directory to recursively load all configuration files it contains
89
* deprecated the concept of scopes
910
* added `Definition::setShared()` and `Definition::isShared()`

src/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* for containers, allowing logic to be implemented based on a Container's state.
1717
*
1818
* @author Evan Villemez <evillemez@gmail.com>
19+
*
20+
* @deprecated since version 2.8, to be merged with ContainerInterface in 3.0.
1921
*/
2022
interface IntrospectableContainerInterface extends ContainerInterface
2123
{

src/Symfony/Component/Security/Http/Tests/Firewall/SimplePreAuthenticationListenerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testHandle()
4242
->will($this->returnValue($this->token))
4343
;
4444

45-
$simpleAuthenticator = $this->getMock('Symfony\Component\Security\Core\Authentication\SimplePreAuthenticatorInterface');
45+
$simpleAuthenticator = $this->getMock('Symfony\Component\Security\Http\Authentication\SimplePreAuthenticatorInterface');
4646
$simpleAuthenticator
4747
->expects($this->once())
4848
->method('createToken')
@@ -79,7 +79,7 @@ public function testHandlecatchAuthenticationException()
7979
->with($this->equalTo(null))
8080
;
8181

82-
$simpleAuthenticator = $this->getMock('Symfony\Component\Security\Core\Authentication\SimplePreAuthenticatorInterface');
82+
$simpleAuthenticator = $this->getMock('Symfony\Component\Security\Http\Authentication\SimplePreAuthenticatorInterface');
8383
$simpleAuthenticator
8484
->expects($this->once())
8585
->method('createToken')

0 commit comments

Comments
 (0)
0