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
This commit is contained in:
Fabien Potencier 2015-09-06 10:10:56 +02:00
commit d5c046d8c5
5 changed files with 11 additions and 8 deletions

View File

@ -68,11 +68,13 @@ class ProxyDumper implements DumperInterface
{
$instantiation = 'return';
if ($definition->isShared() && ContainerInterface::SCOPE_CONTAINER === $definition->getScope(false)) {
if ($definition->isShared()) {
$instantiation .= " \$this->services['$id'] =";
} elseif ($definition->isShared() && ContainerInterface::SCOPE_PROTOTYPE !== $scope = $definition->getScope(false)) {
$instantiation .= " \$this->services['$id'] = \$this->scopedServices['$scope']['$id'] =";
}
if (defined('Symfony\Component\DependencyInjection\ContainerInterface::SCOPE_CONTAINER') && ContainerInterface::SCOPE_CONTAINER !== $scope = $definition->getScope(false)) {
$instantiation .= " \$this->scopedServices['$scope']['$id'] =";
}
}
$methodName = 'get'.Container::camelize($id).'Service';
$proxyClass = $this->getProxyClassName($definition);

View File

@ -27,9 +27,7 @@
"symfony/config": "~2.8|~3.0.0",
"symfony/console": "~2.7|~3.0.0",
"symfony/css-selector": "~2.0,>=2.0.5|~3.0.0",
"symfony/dependency-injection": "~2.6,>=2.6.6|~3.0.0",
"symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0",
"symfony/form": "~2.8",
"symfony/framework-bundle": "~2.8",
"symfony/http-foundation": "~2.4|~3.0.0",
"symfony/twig-bundle": "~2.7|~3.0.0",

View File

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

View File

@ -16,6 +16,8 @@ namespace Symfony\Component\DependencyInjection;
* for containers, allowing logic to be implemented based on a Container's state.
*
* @author Evan Villemez <evillemez@gmail.com>
*
* @deprecated since version 2.8, to be merged with ContainerInterface in 3.0.
*/
interface IntrospectableContainerInterface extends ContainerInterface
{

View File

@ -42,7 +42,7 @@ class SimplePreAuthenticationListenerTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue($this->token))
;
$simpleAuthenticator = $this->getMock('Symfony\Component\Security\Core\Authentication\SimplePreAuthenticatorInterface');
$simpleAuthenticator = $this->getMock('Symfony\Component\Security\Http\Authentication\SimplePreAuthenticatorInterface');
$simpleAuthenticator
->expects($this->once())
->method('createToken')
@ -79,7 +79,7 @@ class SimplePreAuthenticationListenerTest extends \PHPUnit_Framework_TestCase
->with($this->equalTo(null))
;
$simpleAuthenticator = $this->getMock('Symfony\Component\Security\Core\Authentication\SimplePreAuthenticatorInterface');
$simpleAuthenticator = $this->getMock('Symfony\Component\Security\Http\Authentication\SimplePreAuthenticatorInterface');
$simpleAuthenticator
->expects($this->once())
->method('createToken')