8000 Remove various legacy code paths · symfony/symfony@ccbe132 · GitHub
[go: up one dir, main page]

Skip to content

Commit ccbe132

Browse files
Remove various legacy code paths
1 parent ba40486 commit ccbe132

26 files changed

+287
-363
lines changed

src/Symfony/Bundle/SecurityBundle/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ CHANGELOG
1010
* The `SimpleFormFactory` and `SimplePreAuthenticationFactory` classes have been removed,
1111
use Guard instead.
1212
* Removed `LogoutUrlHelper` and `SecurityHelp 6D47 er` templating helpers, use Twig instead
13+
* Removed the `logout_on_user_change` firewall option
14+
* Removed the `threads` encoder option
1315

1416
4.3.0
1517
-----

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,6 @@ private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $facto
205205
->scalarNode('provider')->end()
206206
->booleanNode('stateless')->defaultFalse()->end()
207207
->scalarNode('context')->cannotBeEmpty()->end()
208-
->booleanNode('logout_on_user_change')
209-
->defaultTrue()
210-
->info('When true, it will trigger a logout for the user if something has changed. Note: No-Op option since 4.0. Will always be true.')
211-
->setDeprecated('The "%path%.%node%" configuration key has been deprecated in Symfony 4.1.')
212-
->end()
213208
->arrayNode('logout')
214209
->treatTrueLike([])
215210
->canBeUnset()
@@ -415,10 +410,6 @@ private function addEncodersSection(ArrayNodeDefinition $rootNode)
415410
->end()
416411
->scalarNode('memory_cost')->defaultNull()->end()
417412
->scalarNode('time_cost')->defaultNull()->end()
418-
->scalarNode('threads')
419-
->defaultNull()
420-
->setDeprecated('The "%path%.%node%" configuration key has no effect since Symfony 4.3 and will be removed in 5.0.')
421-
->end()
422413
->scalarNode('id')->end()
423414
->end()
424415
->end()

src/Symfony/Bundle/SecurityBundle/Tests/Debug/TraceableFirewallListenerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public function testOnKernelRequestRecordsListeners()
5151
->willReturn([[$listener], null, null]);
5252

5353
$firewall = new TraceableFirewallListener($firewallMap, new EventDispatcher(), new LogoutUrlGenerator());
54+
$firewall->configureLogoutUrlGenerator($event);
5455
$firewall->onKernelRequest($event);
5556

5657
$listeners = $firewall->getWrappedListeners();

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ public function testEncoders()
285285
'cost' => null,
286286
'memory_cost' => null,
287287
'time_cost' => null,
288-
'threads' => null,
289288
],
290289
'JMS\FooBundle\Entity\User3' => [
291290
'algorithm' => 'md5',
@@ -297,7 +296,6 @@ public function testEncoders()
297296
'cost' => null,
298297
'memory_cost' => null,
299298
'time_cost' => null,
300-
'threads' => null,
301299
],
302300
'JMS\FooBundle\Entity\User4' => new Reference('security.encoder.foo'),
303301
'JMS\FooBundle\Entity\User5' => [
@@ -318,7 +316,6 @@ public function testEncoders()
318316
'cost' => null,
319317
'memory_cost' => null,
320318
'time_cost' => null,
321-
'threads' => null,
322319
],
323320
]], $container->getDefinition('security.encoder_factory.generic')->getArguments());
324321
}
@@ -346,7 +343,6 @@ public function testEncodersWithLibsodium()
346343
'cost' => null,
347344
'memory_cost' => null,
348345
'time_cost' => null,
349-
'threads' => null,
350346
],
351347
'JMS\FooBundle\Entity\User3' => [
352348
'algorithm' => 'md5',
@@ -358,7 +354,6 @@ public function testEncodersWithLibsodium()
358354
'cost' => null,
359355
'memory_cost' => null,
360356
'time_cost' => null,
361-
'threads' => null,
362357
],
363358
'JMS\FooBundle\Entity\User4' => new Reference('security.encoder.foo'),
364359
'JMS\FooBundle\Entity\User5' => [

src/Symfony/Component/Config/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ CHANGELOG
33

44
5.0.0
55
-----
6+
67
* Dropped support for constructing a `TreeBuilder` without passing root node information.
78
* Removed the `root()` method in `TreeBuilder`, pass the root node information to the constructor instead
9+
* Added method `getChildNodeDefinitions()` to ParentNodeDefinitionInterface
810

911
4.3.0
1012
-----

src/Symfony/Component/Config/Definition/Builder/ParentNodeDefinitionInterface.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
* An interface that must be implemented by nodes which can have children.
1616
*
1717
* @author Victor Berchet <victor@suumit.com>
18-
*
19-
* @method NodeDefinition[] getChildNodeDefinitions() Gets the child node definitions - not implementing it is deprecated since Symfony 4.2
2018
*/
2119
interface ParentNodeDefinitionInterface extends BuilderAwareInterface
2220
{
@@ -43,4 +41,11 @@ public function children();
4341
* @return $this
4442
*/
4543
public function append(NodeDefinition $node);
44+
45+
/**
46+
* Gets the child node definitions.
47+
*
48+
* @return NodeDefinition[]
49+
*/
50+
public function getChildNodeDefinitions();
4651
}

src/Symfony/Component/Form/Extension/Core/Type/FileType.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,8 @@ class FileType extends AbstractType
3535

3636
private $translator;
3737

38-
/**
39-
* @param TranslatorInterface|null $translator
40-
*/
41-
public function __construct($translator = null)
38+
public function __construct(TranslatorInterface $translator = null)
4239
{
43-
if (null !== $translator && !$translator instanceof LegacyTranslatorInterface && !$translator instanceof TranslatorInterface) {
44-
throw new \TypeError(sprintf('Argument 1 passed to %s() must be an instance of %s, %s given.', __METHOD__, TranslatorInterface::class, \is_object($translator) ? \get_class($translator) : \gettype($translator)));
45-
}
4640
$this->translator = $translator;
4741
}
4842

src/Symfony/Component/Form/Form.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Form;
1313

14-
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
1514
use Symfony\Component\Form\Event\PostSetDataEvent;
1615
use Symfony\Component\Form\Event\PostSubmitEvent;
1716
use Symfony\Component\Form\Event\PreSetDataEvent;
@@ -334,7 +333,7 @@ public function setData($modelData)
334333
}
335334

336335
$this->lockSetData = true;
337-
$dispatcher = LegacyEventDispatcherProxy::decorate($this->config->getEventDispatcher());
336+
$dispatcher = $this->config->getEventDispatcher();
338337

339338
// Hook to change content of the model data before transformation and mapping children
340339
if ($dispatcher->hasListeners(FormEvents::PRE_SET_DATA)) {
@@ -541,7 +540,7 @@ public function submit($submittedData, $clearMissing = true)
541540
$this->transformationFailure = new TransformationFailedException('Submitted data was expected to be text or number, array given.');
542541
}
543542

544-
$dispatcher = LegacyEventDispatcherProxy::decorate($this->config->getEventDispatcher());
543+
$dispatcher = $this->config->getEventDispatcher();
545544

546545
$modelData = null;
547546
$normData = null;

src/Symfony/Component/HttpKernel/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ CHANGELOG
1717
* removed `GetResponseForExceptionEvent`, use `ExceptionEvent` instead
1818
* removed `PostResponseEvent`, use `TerminateEvent` instead
1919
* removed `SaveSessionListener` in favor of `AbstractSessionListener`
20+
* removed `Client`, use `HttpKernelBrowser` instead
21+
* added method `getProjectDir()` to `KernelInterface`
2022

2123
4.3.0
2224
-----

src/Symfony/Component/HttpKernel/Client.php

Lines changed: 0 additions & 201 deletions
This file was deleted.

src/Symfony/Component/HttpKernel/Fragment/InlineFragmentRenderer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\HttpKernel\Fragment;
1313

14-
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
1514
use Symfony\Component\HttpFoundation\Request;
1615
use Symfony\Component\HttpFoundation\Response;
1716
use Symfony\Component\HttpKernel\Controller\ControllerReference;
@@ -34,7 +33,7 @@ class InlineFragmentRenderer extends RoutableFragmentRenderer
3433
public function __construct(HttpKernelInterface $kernel, EventDispatcherInterface $dispatcher = null)
3534
{
3635
$this->kernel = $kernel;
37-
$this->dispatcher = LegacyEventDispatcherProxy::decorate($dispatcher);
36+
$this->dispatcher = $dispatcher;
3837
}
3938

4039
/**

src/Symfony/Component/HttpKernel/HttpKernel.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\HttpKernel;
1313

14-
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
1514
use Symfony\Component\HttpFoundation\Exception\RequestExceptionInterface;
1615
use Symfony\Component\HttpFoundation\Request;
1716
use Symfony\Component\HttpFoundation\RequestStack;
@@ -47,7 +46,7 @@ class HttpKernel implements HttpKernelInterface, TerminableInterface
4746

4847
public function __construct(EventDispatcherInterface $dispatcher, ControllerResolverInterface $resolver, RequestStack $requestStack = null, ArgumentResolverInterface $argumentResolver = null)
4948
{
50-
$this->dispatcher = LegacyEventDispatcherProxy::decorate($dispatcher);
49+
$this->dispatcher = $dispatcher;
5150
$this->resolver = $resolver;
5251
$this->requestStack = $requestStack ?: new RequestStack();
5352
$this->argumentResolver = $argumentResolver;

0 commit comments

Comments
 (0)
0