Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita1ce27c

Browse files
committed
[Routing] remove deprecations
1 parent090cf32 commita1ce27c

File tree

18 files changed

+23
-1337
lines changed

18 files changed

+23
-1337
lines changed

‎src/Symfony/Bundle/FrameworkBundle/CacheWarmer/RouterCacheWarmer.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function warmUp($cacheDir)
4949
return;
5050
}
5151

52-
@trigger_error(sprintf('Passing a %swithout implementing %s is deprecated since Symfony 4.1.',RouterInterface::class, WarmableInterface::class), \E_USER_DEPRECATED);
52+
thrownew \LogicException(sprintf('The router %scannot be warmed up because it does not implement %s.',\get_class($router), WarmableInterface::class));
5353
}
5454

5555
/**

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
useSymfony\Bridge\Twig\Extension\CsrfExtension;
2222
useSymfony\Bundle\FrameworkBundle\Controller\AbstractController;
2323
useSymfony\Bundle\FrameworkBundle\Routing\AnnotatedRouteControllerLoader;
24-
useSymfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher;
2524
useSymfony\Bundle\FullStack;
2625
useSymfony\Component\Asset\PackageInterface;
2726
useSymfony\Component\BrowserKit\AbstractBrowser;
@@ -88,12 +87,8 @@
8887
useSymfony\Component\PropertyInfo\PropertyInitializableExtractorInterface;
8988
useSymfony\Component\PropertyInfo\PropertyListExtractorInterface;
9089
useSymfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
91-
useSymfony\Component\Routing\Generator\Dumper\PhpGeneratorDumper;
92-
useSymfony\Component\Routing\Generator\UrlGenerator;
9390
useSymfony\Component\Routing\Loader\AnnotationDirectoryLoader;
9491
useSymfony\Component\Routing\Loader\AnnotationFileLoader;
95-
useSymfony\Component\Routing\Matcher\CompiledUrlMatcher;
96-
useSymfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper;
9792
useSymfony\Component\Security\Core\Security;
9893
useSymfony\Component\Security\Csrf\CsrfTokenManagerInterface;
9994
useSymfony\Component\Serializer\Encoder\DecoderInterface;
@@ -824,19 +819,12 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co
824819
}
825820

826821
$container->setParameter('router.resource',$config['resource']);
827-
$container->setParameter('router.cache_class_prefix',$container->getParameter('kernel.container_class'));// deprecated
828822
$router =$container->findDefinition('router.default');
829823
$argument =$router->getArgument(2);
830824
$argument['strict_requirements'] =$config['strict_requirements'];
831825
if (isset($config['type'])) {
832826
$argument['resource_type'] =$config['type'];
833827
}
834-
if (!class_exists(CompiledUrlMatcher::class)) {
835-
$argument['matcher_class'] =$argument['matcher_base_class'] =$argument['matcher_base_class'] ?? RedirectableUrlMatcher::class;
836-
$argument['matcher_dumper_class'] = PhpMatcherDumper::class;
837-
$argument['generator_class'] =$argument['generator_base_class'] =$argument['generator_base_class'] ?? UrlGenerator::class;
838-
$argument['generator_dumper_class'] = PhpGeneratorDumper::class;
839-
}
840828
$router->replaceArgument(2,$argument);
841829

842830
$container->setParameter('request_listener.http_port',$config['http_port']);

‎src/Symfony/Bundle/FrameworkBundle/Routing/RedirectableUrlMatcher.php‎

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

‎src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/RouterCacheWarmerTest.php‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,15 @@ public function testWarmUpWithWarmebleInterface()
3232
$this->addToAssertionCount(1);
3333
}
3434

35-
/**
36-
* @expectedDeprecation Passing a Symfony\Component\Routing\RouterInterface without implementing Symfony\Component\HttpKernel\CacheWarmer\WarmableInterface is deprecated since Symfony 4.1.
37-
* @group legacy
38-
*/
3935
publicfunctiontestWarmUpWithoutWarmebleInterface()
4036
{
4137
$containerMock =$this->getMockBuilder(ContainerInterface::class)->setMethods(['get','has'])->getMock();
4238

4339
$routerMock =$this->getMockBuilder(testRouterInterfaceWithoutWarmebleInterface::class)->setMethods(['match','generate','getContext','setContext','getRouteCollection'])->getMock();
4440
$containerMock->expects($this->any())->method('get')->with('router')->willReturn($routerMock);
4541
$routerCacheWarmer =newRouterCacheWarmer($containerMock);
42+
$this->expectException(\LogicException::class);
43+
$this->expectExceptionMessage('cannot be warmed up because it does not implement Symfony\Component\HttpKernel\CacheWarmer\WarmableInterface');
4644
$routerCacheWarmer->warmUp('/tmp');
4745
}
4846
}

‎src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RedirectableUrlMatcherTest.php‎

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

‎src/Symfony/Component/Routing/CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
CHANGELOG
22
=========
33

4+
5.0.0
5+
-----
6+
7+
* removed`PhpGeneratorDumper` and`PhpMatcherDumper`
8+
* removed`generator_base_class`,`generator_cache_class`,`matcher_base_class` and`matcher_cache_class` router options
9+
* removed`Serializable` implementation for`Route` and`CompiledRoute`
10+
* removed referencing service route loaders with a single colon
11+
412
4.3.0
513
-----
614

‎src/Symfony/Component/Routing/CompiledRoute.php‎

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @author Fabien Potencier <fabien@symfony.com>
1818
*/
19-
class CompiledRouteimplements \Serializable
19+
class CompiledRoute
2020
{
2121
private$variables;
2222
private$tokens;
@@ -63,14 +63,6 @@ public function __serialize(): array
6363
];
6464
}
6565

66-
/**
67-
* @internal since Symfony 4.3, will be removed in Symfony 5 as the class won't implement Serializable anymore
68-
*/
69-
publicfunctionserialize()
70-
{
71-
returnserialize($this->__serialize());
72-
}
73-
7466
publicfunction__unserialize(array$data):void
7567
{
7668
$this->variables =$data['vars'];
@@ -83,14 +75,6 @@ public function __unserialize(array $data): void
8375
$this->hostVariables =$data['host_vars'];
8476
}
8577

86-
/**
87-
* @internal since Symfony 4.3, will be removed in Symfony 5 as the class won't implement Serializable anymore
88-
*/
89-
publicfunctionunserialize($serialized)
90-
{
91-
$this->__unserialize(unserialize($serialized, ['allowed_classes' =>false]));
92-
}
93-
9478
/**
9579
* Returns the static prefix.
9680
*

‎src/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php‎

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

‎src/Symfony/Component/Routing/Loader/ObjectRouteLoader.php‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ public function load($resource, $type = null)
4848
thrownew \InvalidArgumentException(sprintf('Invalid resource "%s" passed to the "service" route loader: use the format "service::method" or "service" if your service has an "__invoke" method.',$resource));
4949
}
5050

51-
if (1 ===substr_count($resource,':')) {
52-
$resource =str_replace(':','::',$resource);
53-
@trigger_error(sprintf('Referencing service route loaders with a single colon is deprecated since Symfony 4.1. Use %s instead.',$resource),E_USER_DEPRECATED);
54-
}
55-
5651
$parts =explode('::',$resource);
5752
$serviceString =$parts[0];
5853
$method =$parts[1] ??'__invoke';

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp