Skip to content

Commit cf00efa

Browse files
committed
remove deprecated features
1 parent 73ef4a9 commit cf00efa

File tree

14 files changed

+52
-436
lines changed

14 files changed

+52
-436
lines changed

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

-4
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,6 @@ private function createFirewalls($config, ContainerBuilder $container)
187187
$customUserChecker = true;
188188
}
189189

190-
if (!isset($firewall['logout_on_user_change']) || !$firewall['logout_on_user_change']) {
191-
@trigger_error('Setting logout_on_user_change to false is deprecated as of 3.4 and will always be true in 4.0. Set logout_on_user_change to true in your firewall configuration.', E_USER_DEPRECATED);
192-
}
193-
194190
$contextListenerDefinition->addMethodCall('setLogoutOnUserChange', array($firewall['logout_on_user_change']));
195191

196192
$configId = 'security.firewall.map.config.'.$name;

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php

-25
Original file line numberDiff line numberDiff line change
@@ -123,31 +123,6 @@ public function testDisableRoleHierarchyVoter()
123123
$this->assertFalse($container->hasDefinition('security.access.role_hierarchy_voter'));
124124
}
125125

126-
/**
127-
* @group legacy
128-
* @expectedDeprecation Setting logout_on_user_change to false is deprecated as of 3.4 and will always be true in 4.0. Set logout_on_user_change to true in your firewall configuration.
129-
*/
130-
public function testDeprecationForUserLogout()
131-
{
132-
$container = $this->getRawContainer();
133-
134-
$container->loadFromExtension('security', array(
135-
'providers' => array(
136-
'default' => array('id' => 'foo'),
137-
),
138-
139-
'firewalls' => array(
140-
'some_firewall' => array(
141-
'pattern' => '/.*',
142-
'http_basic' => null,
143-
'logout_on_user_change' => false,
144-
),
145-
),
146-
));
147-
148-
$container->compile();
149-
}
150-
151126
protected function getRawContainer()
152127
{
153128
$container = new ContainerBuilder();

src/Symfony/Component/DependencyInjection/Compiler/AutowireExceptionPass.php

-74
This file was deleted.

src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php

-57
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,6 @@ public function __construct($throwOnAutowireException = true)
4141
$this->throwOnAutowiringException = $throwOnAutowireException;
4242
}
4343

44-
/**
45-
* @deprecated since version 3.4, to be removed in 4.0.
46-
*
47-
* @return AutowiringFailedException[]
48-
*/
49-
public function getAutowiringExceptions()
50-
{
51-
@trigger_error('Calling AutowirePass::getAutowiringExceptions() is deprecated since Symfony 3.4 and will be removed in 4.0. Use Definition::getErrors() instead.', E_USER_DEPRECATED);
52-
53-
return $this->autowiringExceptions;
54-
}
55-
5644
/**
5745
* {@inheritdoc}
5846
*/
@@ -270,8 +258,6 @@ private function getAutowiredReference(TypedReference $reference, $deprecationMe
270258
if (isset($this->autowired[$type])) {
271259
return $this->autowired[$type] ? new TypedReference($this->autowired[$type], $type) : null;
272260
}
273-
274-
return $this->createAutowiredDefinition($type);
275261
}
276262

277263
/**
@@ -342,49 +328,6 @@ private function set($type, $id)
342328
$this->ambiguousServiceTypes[$type][] = $id;
343329
}
344330

345-
/**
346-
* Registers a definition for the type if possible or throws an exception.
347-
*
348-
* @param string $type
349-
*
350-
* @return TypedReference|null A reference to the registered definition
351-
*/
352-
private function createAutowiredDefinition($type)
353-
{
354-
if (!($typeHint = $this->container->getReflectionClass($type, false)) || !$typeHint->isInstantiable()) {
355-
return;
356-
}
357-
358-
$currentId = $this->currentId;
359-
$this->currentId = $type;
360-
$this->autowired[$type] = $argumentId = sprintf('autowired.%s', $type);
361-
$argumentDefinition = new Definition($type);
362-
$argumentDefinition->setPublic(false);
363-
$argumentDefinition->setAutowired(true);
364-
365-
try {
366-
$originalThrowSetting = $this->throwOnAutowiringException;
367-
$this->throwOnAutowiringException = true;
368-
$this->processValue($argumentDefinition, true);
369-
$this->container->setDefinition($argumentId, $argumentDefinition);
370-
} catch (AutowiringFailedException $e) {
371-
$this->autowired[$type] = false;
372-
$this->lastFailure = $e->getMessage();
373-
$this->container->log($this, $this->lastFailure);
374-
375-
return;
376-
} finally {
377-
$this->throwOnAutowiringException = $originalThrowSetting;
378-
$this->currentId = $currentId;
379-
}
380-
381-
@trigger_error(sprintf('Relying on service auto-registration for type "%s" is deprecated since version 3.4 and won\'t be supported in 4.0. Create a service named "%s" instead.', $type, $type), E_USER_DEPRECATED);
382-
383-
$this->container->log($this, sprintf('Type "%s" has been auto-registered for service "%s".', $type, $this->currentId));
384-
385-
return new TypedReference($argumentId, $type);
386-
}
387-
388331
private function createTypeNotFoundMessage(TypedReference $reference, $label)
389332
{
390333
if (!$r = $this->container->getReflectionClass($type = $reference->getType(), false)) {

src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php

-18
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
class InlineServiceDefinitionsPass extends AbstractRecursivePass implements RepeatablePassInterface
2424
{
2525
private $repeatedPass;
26-
private $inlinedServiceIds = array();
2726

2827
/**
2928
* {@inheritdoc}
@@ -33,22 +32,6 @@ public function setRepeatedPass(RepeatedPass $repeatedPass)
3332
$this->repeatedPass = $repeatedPass;
3433
}
3534

36-
/**
37-
* Returns an array of all services inlined by this pass.
38-
*
39-
* The key is the inlined service id and its value is the list of services it was inlined into.
40-
*
41-
* @deprecated since version 3.4, to be removed in 4.0.
42-
*
43-
* @return array
44-
*/
45-
public function getInlinedServiceIds()
46-
{
47-
@trigger_error('Calling InlineServiceDefinitionsPass::getInlinedServiceIds() is deprecated since Symfony 3.4 and will be removed in 4.0.', E_USER_DEPRECATED);
48-
49-
return $this->inlinedServiceIds;
50-
}
51-
5235
/**
5336
* {@inheritdoc}
5437
*/
@@ -63,7 +46,6 @@ protected function processValue($value, $isRoot = false)
6346

6447
if ($this->isInlineableDefinition($id, $definition, $this->container->getCompiler()->getServiceReferenceGraph())) {
6548
$this->container->log($this, sprintf('Inlined service "%s" to "%s".', $id, $this->currentId));
66-
$this->inlinedServiceIds[$id][] = $this->currentId;
6749

6850
if ($definition->isShared()) {
6951
return $definition;

src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowireExceptionPassTest.php

-145
This file was deleted.

0 commit comments

Comments
 (0)