From ad06f57b65e119f7e8024aed198ab6feda1da4ee Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 24 Jan 2023 15:02:24 +0100 Subject: [PATCH 1/7] Update license years (last time) --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 00837045..0138f8f0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2023 Fabien Potencier +Copyright (c) 2004-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 17b3787287e3b5a62d7a589a8626b7bae99149ec Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 7 Feb 2023 10:31:13 +0100 Subject: [PATCH 2/7] minor #49253 [PHPUnit 10] Use `TestCase` suffix for abstract tests in `/Tests/` (OskarStark) This PR was merged into the 6.3 branch. Discussion ---------- [PHPUnit 10] Use `TestCase` suffix for abstract tests in `/Tests/` | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Refs https://github.com/symfony/symfony/pull/49233 | License | MIT | Doc PR | n/a Replaces #49234 Using `Test` suffix is deprecated since PHPUnit 10 Spotted in * https://github.com/symfony/symfony/pull/49233 Commits ------- cb3db968e4 [PHPUnit 10] Use `TestCase` suffix for abstract tests in `/Tests/` --- ...ationLoaderTest.php => AbstractAnnotationLoaderTestCase.php} | 2 +- ...ionClassLoaderTest.php => AnnotationClassLoaderTestCase.php} | 2 +- Tests/Loader/AnnotationClassLoaderWithAnnotationsTest.php | 2 +- Tests/Loader/AnnotationClassLoaderWithAttributesTest.php | 2 +- Tests/Loader/AnnotationDirectoryLoaderTest.php | 2 +- Tests/Loader/AnnotationFileLoaderTest.php | 2 +- Tests/Loader/DirectoryLoaderTest.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) rename Tests/Loader/{AbstractAnnotationLoaderTest.php => AbstractAnnotationLoaderTestCase.php} (92%) rename Tests/Loader/{AnnotationClassLoaderTest.php => AnnotationClassLoaderTestCase.php} (99%) diff --git a/Tests/Loader/AbstractAnnotationLoaderTest.php b/Tests/Loader/AbstractAnnotationLoaderTestCase.php similarity index 92% rename from Tests/Loader/AbstractAnnotationLoaderTest.php rename to Tests/Loader/AbstractAnnotationLoaderTestCase.php index fea06e51..e743ef2e 100644 --- a/Tests/Loader/AbstractAnnotationLoaderTest.php +++ b/Tests/Loader/AbstractAnnotationLoaderTestCase.php @@ -14,7 +14,7 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\Routing\Loader\AnnotationClassLoader; -abstract class AbstractAnnotationLoaderTest extends TestCase +abstract class AbstractAnnotationLoaderTestCase extends TestCase { public function getReader() { diff --git a/Tests/Loader/AnnotationClassLoaderTest.php b/Tests/Loader/AnnotationClassLoaderTestCase.php similarity index 99% rename from Tests/Loader/AnnotationClassLoaderTest.php rename to Tests/Loader/AnnotationClassLoaderTestCase.php index fdac1aea..0c820fc2 100644 --- a/Tests/Loader/AnnotationClassLoaderTest.php +++ b/Tests/Loader/AnnotationClassLoaderTestCase.php @@ -15,7 +15,7 @@ use Symfony\Component\Routing\Loader\AnnotationClassLoader; use Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures\AbstractClassController; -abstract class AnnotationClassLoaderTest extends TestCase +abstract class AnnotationClassLoaderTestCase extends TestCase { /** * @var AnnotationClassLoader diff --git a/Tests/Loader/AnnotationClassLoaderWithAnnotationsTest.php b/Tests/Loader/AnnotationClassLoaderWithAnnotationsTest.php index e2843a0a..1130204b 100644 --- a/Tests/Loader/AnnotationClassLoaderWithAnnotationsTest.php +++ b/Tests/Loader/AnnotationClassLoaderWithAnnotationsTest.php @@ -16,7 +16,7 @@ use Symfony\Component\Routing\Loader\AnnotationClassLoader; use Symfony\Component\Routing\Route; -class AnnotationClassLoaderWithAnnotationsTest extends AnnotationClassLoaderTest +class AnnotationClassLoaderWithAnnotationsTest extends AnnotationClassLoaderTestCase { protected function setUp(string $env = null): void { diff --git a/Tests/Loader/AnnotationClassLoaderWithAttributesTest.php b/Tests/Loader/AnnotationClassLoaderWithAttributesTest.php index 68797617..5ff377aa 100644 --- a/Tests/Loader/AnnotationClassLoaderWithAttributesTest.php +++ b/Tests/Loader/AnnotationClassLoaderWithAttributesTest.php @@ -17,7 +17,7 @@ /** * @requires PHP 8 */ -class AnnotationClassLoaderWithAttributesTest extends AnnotationClassLoaderTest +class AnnotationClassLoaderWithAttributesTest extends AnnotationClassLoaderTestCase { protected function setUp(string $env = null): void { diff --git a/Tests/Loader/AnnotationDirectoryLoaderTest.php b/Tests/Loader/AnnotationDirectoryLoaderTest.php index 858044d4..559c2297 100644 --- a/Tests/Loader/AnnotationDirectoryLoaderTest.php +++ b/Tests/Loader/AnnotationDirectoryLoaderTest.php @@ -14,7 +14,7 @@ use Symfony\Component\Config\FileLocator; use Symfony\Component\Routing\Loader\AnnotationDirectoryLoader; -class AnnotationDirectoryLoaderTest extends AbstractAnnotationLoaderTest +class AnnotationDirectoryLoaderTest extends AbstractAnnotationLoaderTestCase { protected $loader; protected $reader; diff --git a/Tests/Loader/AnnotationFileLoaderTest.php b/Tests/Loader/AnnotationFileLoaderTest.php index 0e1331bf..9cc38430 100644 --- a/Tests/Loader/AnnotationFileLoaderTest.php +++ b/Tests/Loader/AnnotationFileLoaderTest.php @@ -15,7 +15,7 @@ use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Loader\AnnotationFileLoader; -class AnnotationFileLoaderTest extends AbstractAnnotationLoaderTest +class AnnotationFileLoaderTest extends AbstractAnnotationLoaderTestCase { protected $loader; protected $reader; diff --git a/Tests/Loader/DirectoryLoaderTest.php b/Tests/Loader/DirectoryLoaderTest.php index 184d5089..d4f2fd32 100644 --- a/Tests/Loader/DirectoryLoaderTest.php +++ b/Tests/Loader/DirectoryLoaderTest.php @@ -18,7 +18,7 @@ use Symfony\Component\Routing\Loader\YamlFileLoader; use Symfony\Component\Routing\RouteCollection; -class DirectoryLoaderTest extends AbstractAnnotationLoaderTest +class DirectoryLoaderTest extends AbstractAnnotationLoaderTestCase { private $loader; private $reader; From 55b0015b8bb38164b69c7c139df976495662f1ff Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Wed, 14 Dec 2022 15:42:16 +0100 Subject: [PATCH 3/7] Migrate to `static` data providers using `rector/rector` --- Tests/Annotation/RouteTest.php | 4 ++-- Tests/Generator/UrlGeneratorTest.php | 6 +++--- Tests/Loader/AnnotationClassLoaderTestCase.php | 2 +- Tests/Loader/ContainerLoaderTest.php | 2 +- Tests/Loader/ObjectLoaderTest.php | 2 +- Tests/Loader/XmlFileLoaderTest.php | 4 ++-- Tests/Loader/YamlFileLoaderTest.php | 4 ++-- Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php | 2 +- Tests/Matcher/Dumper/StaticPrefixCollectionTest.php | 2 +- Tests/Matcher/ExpressionLanguageProviderTest.php | 4 ++-- Tests/RouteCollectionBuilderTest.php | 2 +- Tests/RouteCompilerTest.php | 10 +++++----- Tests/RouteTest.php | 6 +++--- 13 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Tests/Annotation/RouteTest.php b/Tests/Annotation/RouteTest.php index e249aa5d..f7e42a60 100644 --- a/Tests/Annotation/RouteTest.php +++ b/Tests/Annotation/RouteTest.php @@ -42,7 +42,7 @@ private function getMethodAnnotation(string $method, bool $attributes): Route return $route; } - public function provideDeprecationArrayAsFirstArgument() + public static function provideDeprecationArrayAsFirstArgument() { return [ ['requirements', ['locale' => 'en'], 'getRequirements'], @@ -89,7 +89,7 @@ public function testLoadFromDoctrineAnnotation(string $methodName, string $gette $this->assertEquals($route->$getter(), $expectedReturn); } - public function getValidParameters(): iterable + public static function getValidParameters(): iterable { return [ ['simplePath', 'getPath', '/Blog'], diff --git a/Tests/Generator/UrlGeneratorTest.php b/Tests/Generator/UrlGeneratorTest.php index 71501d2a..f2062e8e 100644 --- a/Tests/Generator/UrlGeneratorTest.php +++ b/Tests/Generator/UrlGeneratorTest.php @@ -130,7 +130,7 @@ public function testAbsoluteUrlWithExtraParameters(string $expectedQueryString, $this->assertSame('http://localhost/app.php/testing'.$expectedQueryString, $url); } - public function valuesProvider(): array + public static function valuesProvider(): array { $stdClass = new \stdClass(); $stdClass->baz = 'bar'; @@ -862,7 +862,7 @@ public function testGetRelativePath($sourcePath, $targetPath, $expectedPath) $this->assertSame($expectedPath, UrlGenerator::getRelativePath($sourcePath, $targetPath)); } - public function provideRelativePaths() + public static function provideRelativePaths() { return [ [ @@ -1004,7 +1004,7 @@ public function testLookRoundRequirementsInPath($expected, $path, $requirement) $this->assertSame($expected, $this->getGenerator($routes)->generate('test', ['foo' => 'a/b', 'baz' => 'c/d/e'])); } - public function provideLookAroundRequirementsInPath() + public static function provideLookAroundRequirementsInPath() { yield ['/app.php/a/b/b%28ar/c/d/e', '/{foo}/b(ar/{baz}', '.+(?=/b\\(ar/)']; yield ['/app.php/a/b/bar/c/d/e', '/{foo}/bar/{baz}', '.+(?!$)']; diff --git a/Tests/Loader/AnnotationClassLoaderTestCase.php b/Tests/Loader/AnnotationClassLoaderTestCase.php index 0c820fc2..e10e9993 100644 --- a/Tests/Loader/AnnotationClassLoaderTestCase.php +++ b/Tests/Loader/AnnotationClassLoaderTestCase.php @@ -30,7 +30,7 @@ public function testSupportsChecksResource($resource, $expectedSupports) $this->assertSame($expectedSupports, $this->loader->supports($resource), '->supports() returns true if the resource is loadable'); } - public function provideTestSupportsChecksResource() + public static function provideTestSupportsChecksResource() { return [ ['class', true], diff --git a/Tests/Loader/ContainerLoaderTest.php b/Tests/Loader/ContainerLoaderTest.php index 5f74111d..6a3e4c51 100644 --- a/Tests/Loader/ContainerLoaderTest.php +++ b/Tests/Loader/ContainerLoaderTest.php @@ -25,7 +25,7 @@ public function testSupports(bool $expected, string $type = null) $this->assertSame($expected, (new ContainerLoader(new Container()))->supports('foo', $type)); } - public function supportsProvider() + public static function supportsProvider() { return [ [true, 'service'], diff --git a/Tests/Loader/ObjectLoaderTest.php b/Tests/Loader/ObjectLoaderTest.php index fcd679ea..6027c3fd 100644 --- a/Tests/Loader/ObjectLoaderTest.php +++ b/Tests/Loader/ObjectLoaderTest.php @@ -50,7 +50,7 @@ public function testExceptionWithoutSyntax(string $resourceString) $loader->load($resourceString); } - public function getBadResourceStrings() + public static function getBadResourceStrings() { return [ ['Foo:Bar:baz'], diff --git a/Tests/Loader/XmlFileLoaderTest.php b/Tests/Loader/XmlFileLoaderTest.php index 7637fd60..ec7bd6ed 100644 --- a/Tests/Loader/XmlFileLoaderTest.php +++ b/Tests/Loader/XmlFileLoaderTest.php @@ -230,7 +230,7 @@ public function testLoadThrowsExceptionWithInvalidFileEvenWithoutSchemaValidatio $loader->load($filePath); } - public function getPathsToInvalidFiles() + public static function getPathsToInvalidFiles() { return [ ['nonvalidnode.xml'], @@ -478,7 +478,7 @@ public function testImportRouteWithController($file) $this->assertSame('FrameworkBundle:Template:template', $route->getDefault('_controller')); } - public function provideFilesImportingRoutesWithControllers() + public static function provideFilesImportingRoutesWithControllers() { yield ['import_controller.xml']; yield ['import__controller.xml']; diff --git a/Tests/Loader/YamlFileLoaderTest.php b/Tests/Loader/YamlFileLoaderTest.php index b509ce36..a81a6b2f 100644 --- a/Tests/Loader/YamlFileLoaderTest.php +++ b/Tests/Loader/YamlFileLoaderTest.php @@ -52,7 +52,7 @@ public function testLoadThrowsExceptionWithInvalidFile($filePath) $loader->load($filePath); } - public function getPathsToInvalidFiles() + public static function getPathsToInvalidFiles() { return [ ['nonvalid.yml'], @@ -171,7 +171,7 @@ public function testImportRouteWithController($file) $this->assertSame('FrameworkBundle:Template:template', $route->getDefault('_controller')); } - public function provideFilesImportingRoutesWithControllers() + public static function provideFilesImportingRoutesWithControllers() { yield ['import_controller.yml']; yield ['import__controller.yml']; diff --git a/Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php b/Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php index 4886d717..91345677 100644 --- a/Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php +++ b/Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php @@ -65,7 +65,7 @@ public function testDump(RouteCollection $collection, $fixture) $this->assertStringEqualsFile($basePath.$fixture, $dumper->dump()); } - public function getRouteCollections() + public static function getRouteCollections() { /* test case 1 */ diff --git a/Tests/Matcher/Dumper/StaticPrefixCollectionTest.php b/Tests/Matcher/Dumper/StaticPrefixCollectionTest.php index d3f4c4f0..86e0d0e3 100644 --- a/Tests/Matcher/Dumper/StaticPrefixCollectionTest.php +++ b/Tests/Matcher/Dumper/StaticPrefixCollectionTest.php @@ -34,7 +34,7 @@ public function testGrouping(array $routes, $expected) $this->assertEquals($expected, $dumped); } - public function routeProvider() + public static function routeProvider() { return [ 'Simple - not nested' => [ diff --git a/Tests/Matcher/ExpressionLanguageProviderTest.php b/Tests/Matcher/ExpressionLanguageProviderTest.php index 0aa3549b..2e431b71 100644 --- a/Tests/Matcher/ExpressionLanguageProviderTest.php +++ b/Tests/Matcher/ExpressionLanguageProviderTest.php @@ -59,7 +59,7 @@ public function testCompile(string $expression, string $expected) $this->assertSame($expected, $this->expressionLanguage->compile($expression)); } - public function compileProvider(): iterable + public static function compileProvider(): iterable { return [ ['env("APP_ENV")', '($context->getParameter(\'_functions\')->get(\'env\')("APP_ENV"))'], @@ -76,7 +76,7 @@ public function testEvaluate(string $expression, $expected) $this->assertSame($expected, $this->expressionLanguage->evaluate($expression, ['context' => $this->context])); } - public function evaluateProvider(): iterable + public static function evaluateProvider(): iterable { return [ ['env("APP_ENV")', 'test'], diff --git a/Tests/RouteCollectionBuilderTest.php b/Tests/RouteCollectionBuilderTest.php index ef0d73a6..682b0cce 100644 --- a/Tests/RouteCollectionBuilderTest.php +++ b/Tests/RouteCollectionBuilderTest.php @@ -251,7 +251,7 @@ public function testFlushPrefixesPaths($collectionPrefix, $routePath, $expectedP $this->assertEquals($expectedPath, $collection->get('test_route')->getPath()); } - public function providePrefixTests() + public static function providePrefixTests() { $tests = []; // empty prefix is of course ok diff --git a/Tests/RouteCompilerTest.php b/Tests/RouteCompilerTest.php index 6f5b91f5..57f61c7e 100644 --- a/Tests/RouteCompilerTest.php +++ b/Tests/RouteCompilerTest.php @@ -32,7 +32,7 @@ public function testCompile($name, $arguments, $prefix, $regex, $variables, $tok $this->assertEquals($tokens, $compiled->getTokens(), $name.' (tokens)'); } - public function provideCompileData() + public static function provideCompileData() { return [ [ @@ -199,7 +199,7 @@ public function testCompileImplicitUtf8Data($name, $arguments, $prefix, $regex, $this->assertEquals($tokens, $compiled->getTokens(), $name.' (tokens)'); } - public function provideCompileImplicitUtf8Data() + public static function provideCompileImplicitUtf8Data() { return [ [ @@ -284,7 +284,7 @@ public function testRouteWithVariableNameStartingWithADigit($name) $route->compile(); } - public function getVariableNamesStartingWithADigit() + public static function getVariableNamesStartingWithADigit() { return [ ['09'], @@ -312,7 +312,7 @@ public function testCompileWithHost($name, $arguments, $prefix, $regex, $variabl $this->assertEquals($hostTokens, $compiled->getHostTokens(), $name.' (host tokens)'); } - public function provideCompileWithHostData() + public static function provideCompileWithHostData() { return [ [ @@ -381,7 +381,7 @@ public function testRemoveCapturingGroup($regex, $requirement) $this->assertSame($regex, $route->compile()->getRegex()); } - public function provideRemoveCapturingGroup() + public static function provideRemoveCapturingGroup() { yield ['{^/(?Pa(?:b|c)(?:d|e)f)$}sD', 'a(b|c)(d|e)f']; yield ['{^/(?Pa\(b\)c)$}sD', 'a\(b\)c']; diff --git a/Tests/RouteTest.php b/Tests/RouteTest.php index 4be50d9a..4d7d9299 100644 --- a/Tests/RouteTest.php +++ b/Tests/RouteTest.php @@ -151,7 +151,7 @@ public function testSetInvalidRequirement($req) $route->setRequirement('foo', $req); } - public function getInvalidRequirements() + public static function getInvalidRequirements() { return [ [''], @@ -354,7 +354,7 @@ public function testLocaleRequirementWithLocalizedRoutes(Route $route) $this->assertSame($expected, $route->getRequirement('_locale')); } - public function provideNonLocalizedRoutes() + public static function provideNonLocalizedRoutes() { return [ [new Route('/foo')], @@ -364,7 +364,7 @@ public function provideNonLocalizedRoutes() ]; } - public function provideLocalizedRoutes() + public static function provideLocalizedRoutes() { return [ [(new Route('/foo'))->setDefault('_locale', 'en')->setDefault('_canonical_route', 'foo')->setRequirement('_locale', 'en')], From fa643fa4c56de161f8bc8c0492a76a60140b50e4 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 14 Feb 2023 09:53:37 +0100 Subject: [PATCH 4/7] Fix merge --- Tests/Annotation/RouteTest.php | 2 +- Tests/Loader/PhpFileLoaderTest.php | 2 +- Tests/Loader/Psr4DirectoryLoaderTest.php | 2 +- Tests/Loader/XmlFileLoaderTest.php | 2 +- Tests/Loader/YamlFileLoaderTest.php | 2 +- Tests/Requirement/EnumRequirementTest.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tests/Annotation/RouteTest.php b/Tests/Annotation/RouteTest.php index 4df94ca2..de671ed9 100644 --- a/Tests/Annotation/RouteTest.php +++ b/Tests/Annotation/RouteTest.php @@ -57,7 +57,7 @@ public function testLoadFromDoctrineAnnotation(string $methodName, string $gette $this->assertEquals($route->$getter(), $expectedReturn); } - public function getValidParameters(): iterable + public static function getValidParameters(): iterable { return [ ['simplePath', 'getPath', '/Blog'], diff --git a/Tests/Loader/PhpFileLoaderTest.php b/Tests/Loader/PhpFileLoaderTest.php index 4d260ce9..48db540a 100644 --- a/Tests/Loader/PhpFileLoaderTest.php +++ b/Tests/Loader/PhpFileLoaderTest.php @@ -324,7 +324,7 @@ protected function configureRoute(Route $route, \ReflectionClass $class, \Reflec $this->assertSame(MyController::class.'::__invoke', $route->getDefault('_controller')); } - public function providePsr4ConfigFiles(): array + public static function providePsr4ConfigFiles(): array { return [ ['psr4-attributes.php'], diff --git a/Tests/Loader/Psr4DirectoryLoaderTest.php b/Tests/Loader/Psr4DirectoryLoaderTest.php index 2bae5900..4b2a4676 100644 --- a/Tests/Loader/Psr4DirectoryLoaderTest.php +++ b/Tests/Loader/Psr4DirectoryLoaderTest.php @@ -81,7 +81,7 @@ public function testPsr4NamespaceTrim(string $namespace) $this->assertSame(MyController::class.'::__invoke', $route->getDefault('_controller')); } - public function provideNamespacesThatNeedTrimming(): array + public static function provideNamespacesThatNeedTrimming(): array { return [ ['\\Symfony\Component\Routing\Tests\Fixtures\Psr4Controllers'], diff --git a/Tests/Loader/XmlFileLoaderTest.php b/Tests/Loader/XmlFileLoaderTest.php index b33e1330..65ea4a9d 100644 --- a/Tests/Loader/XmlFileLoaderTest.php +++ b/Tests/Loader/XmlFileLoaderTest.php @@ -619,7 +619,7 @@ protected function configureRoute(Route $route, \ReflectionClass $class, \Reflec $this->assertSame(MyController::class.'::__invoke', $route->getDefault('_controller')); } - public function providePsr4ConfigFiles(): array + public static function providePsr4ConfigFiles(): array { return [ ['psr4-attributes.xml'], diff --git a/Tests/Loader/YamlFileLoaderTest.php b/Tests/Loader/YamlFileLoaderTest.php index 7e39508b..41d1605e 100644 --- a/Tests/Loader/YamlFileLoaderTest.php +++ b/Tests/Loader/YamlFileLoaderTest.php @@ -485,7 +485,7 @@ protected function configureRoute(Route $route, \ReflectionClass $class, \Reflec $this->assertSame(MyController::class.'::__invoke', $route->getDefault('_controller')); } - public function providePsr4ConfigFiles(): array + public static function providePsr4ConfigFiles(): array { return [ ['psr4-attributes.yaml'], diff --git a/Tests/Requirement/EnumRequirementTest.php b/Tests/Requirement/EnumRequirementTest.php index 75613f49..68b32ea7 100644 --- a/Tests/Requirement/EnumRequirementTest.php +++ b/Tests/Requirement/EnumRequirementTest.php @@ -54,7 +54,7 @@ public function testToString(string $expected, string|array $cases = []) $this->assertSame($expected, (string) new EnumRequirement($cases)); } - public function provideToString() + public static function provideToString() { return [ ['hearts|diamonds|clubs|spades', TestStringBackedEnum::class], From 2ea0f3049076e8ef96eab203a809d6b2332f0361 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 16 Feb 2023 10:33:00 +0100 Subject: [PATCH 5/7] CS fix --- Generator/UrlGenerator.php | 4 ++-- Tests/Annotation/RouteTest.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Generator/UrlGenerator.php b/Generator/UrlGenerator.php index acf3ead4..d27b0000 100644 --- a/Generator/UrlGenerator.php +++ b/Generator/UrlGenerator.php @@ -162,11 +162,11 @@ public function generate(string $name, array $parameters = [], int $referenceTyp } /** + * @return string + * * @throws MissingMandatoryParametersException When some parameters are missing that are mandatory for the route * @throws InvalidParameterException When a parameter value for a placeholder is not correct because * it does not match the requirement - * - * @return string */ protected function doGenerate(array $variables, array $defaults, array $requirements, array $tokens, array $parameters, string $name, int $referenceType, array $hostTokens, array $requiredSchemes = []) { diff --git a/Tests/Annotation/RouteTest.php b/Tests/Annotation/RouteTest.php index f7e42a60..cde5f620 100644 --- a/Tests/Annotation/RouteTest.php +++ b/Tests/Annotation/RouteTest.php @@ -60,6 +60,7 @@ public static function provideDeprecationArrayAsFirstArgument() /** * @group legacy + * * @dataProvider provideDeprecationArrayAsFirstArgument */ public function testDeprecationArrayAsFirstArgument(string $parameter, $value, string $getter) @@ -72,6 +73,7 @@ public function testDeprecationArrayAsFirstArgument(string $parameter, $value, s /** * @requires PHP 8 + * * @dataProvider getValidParameters */ public function testLoadFromAttribute(string $methodName, string $getter, $expectedReturn) From e40da45f4d6f9aeb388df13ff53d6cf32af8fea6 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Mon, 6 Mar 2023 21:48:01 +0100 Subject: [PATCH 6/7] [Tests] Replace `setMethods()` by `onlyMethods()` and `addMethods()` --- Tests/Loader/ObjectLoaderTest.php | 2 +- Tests/Matcher/CompiledRedirectableUrlMatcherTest.php | 2 +- Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/Loader/ObjectLoaderTest.php b/Tests/Loader/ObjectLoaderTest.php index 6027c3fd..498e1fab 100644 --- a/Tests/Loader/ObjectLoaderTest.php +++ b/Tests/Loader/ObjectLoaderTest.php @@ -82,7 +82,7 @@ public function testExceptionOnMethodNotReturningCollection() { $this->expectException(\LogicException::class); $service = $this->getMockBuilder(\stdClass::class) - ->setMethods(['loadRoutes']) + ->addMethods(['loadRoutes']) ->getMock(); $service->expects($this->once()) ->method('loadRoutes') diff --git a/Tests/Matcher/CompiledRedirectableUrlMatcherTest.php b/Tests/Matcher/CompiledRedirectableUrlMatcherTest.php index faf5f181..2dcadc27 100644 --- a/Tests/Matcher/CompiledRedirectableUrlMatcherTest.php +++ b/Tests/Matcher/CompiledRedirectableUrlMatcherTest.php @@ -26,7 +26,7 @@ protected function getUrlMatcher(RouteCollection $routes, RequestContext $contex return $this->getMockBuilder(TestCompiledRedirectableUrlMatcher::class) ->setConstructorArgs([$compiledRoutes, $context ?? new RequestContext()]) - ->setMethods(['redirect']) + ->onlyMethods(['redirect']) ->getMock(); } } diff --git a/Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php b/Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php index 91345677..ffab6780 100644 --- a/Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php +++ b/Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php @@ -486,7 +486,7 @@ private function generateDumpedMatcher(RouteCollection $collection) return $this->getMockBuilder(TestCompiledUrlMatcher::class) ->setConstructorArgs([$compiledRoutes, new RequestContext()]) - ->setMethods(['redirect']) + ->onlyMethods(['redirect']) ->getMock(); } From c2ac11eb34947999b7c38fb4c835a57306907e6d Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 14 Mar 2023 15:59:20 +0100 Subject: [PATCH 7/7] Fix some Composer keywords --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b21ad5f2..c32219e6 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "symfony/routing", "type": "library", "description": "Maps an HTTP request to a set of configuration variables", - "keywords": ["routing", "router", "URL", "URI"], + "keywords": ["routing", "router", "url", "uri"], "homepage": "https://symfony.com", "license": "MIT", "authors": [