diff --git a/UPGRADE-5.0.md b/UPGRADE-5.0.md index 8bb144e81..24b216ff2 100644 --- a/UPGRADE-5.0.md +++ b/UPGRADE-5.0.md @@ -52,4 +52,6 @@ This parameter was deprecated since `4.25.2` ## BC BREAK: Removed `Nelmio\ApiDocBundle\Exception\UndocumentedArrayItemsException` -## BC BREAK: Changed type of parameter `$propertyDescriber` in `Nelmio\ApiDocBundle\ModelDescriber\ObjectModelDescriber::__construct()` from `PropertyDescriberInterface|PropertyDescriberInterface[]` to `PropertyDescriberInterface` \ No newline at end of file +## BC BREAK: Changed type of parameter `$propertyDescriber` in `Nelmio\ApiDocBundle\ModelDescriber\ObjectModelDescriber::__construct()` from `PropertyDescriberInterface|PropertyDescriberInterface[]` to `PropertyDescriberInterface` + +## BC BREAK: Removed passing an indexed array with a collection of path patterns as argument 1 for `Nelmio\ApiDocBundle\Routing\FilteredRouteCollectionBuilder::__construct()` \ No newline at end of file diff --git a/src/Routing/FilteredRouteCollectionBuilder.php b/src/Routing/FilteredRouteCollectionBuilder.php index 02adde0f8..4c943ad04 100644 --- a/src/Routing/FilteredRouteCollectionBuilder.php +++ b/src/Routing/FilteredRouteCollectionBuilder.php @@ -53,13 +53,6 @@ public function __construct( ->setAllowedTypes('disable_default_routes', 'boolean') ; - if (array_key_exists(0, $options)) { - trigger_deprecation('nelmio/api-doc-bundle', '3.2', 'Passing an indexed array with a collection of path patterns as argument 1 for `%s()` is deprecated since 3.2.0, expected structure is an array containing parameterized options.', __METHOD__); - - $normalizedOptions = ['path_patterns' => $options]; - $options = $normalizedOptions; - } - $this->controllerReflector = $controllerReflector; $this->area = $area; $this->options = $resolver->resolve($options); diff --git a/tests/Routing/FilteredRouteCollectionBuilderTest.php b/tests/Routing/FilteredRouteCollectionBuilderTest.php index 6fd199baa..e7f70d8f8 100644 --- a/tests/Routing/FilteredRouteCollectionBuilderTest.php +++ b/tests/Routing/FilteredRouteCollectionBuilderTest.php @@ -57,33 +57,6 @@ public function testFilter(): void self::assertCount(4, $filteredRoutes); } - /** - * @group legacy - * - * @expectedDeprecation Passing an indexed array with a collection of path patterns as argument 1 for `Nelmio\ApiDocBundle\Routing\FilteredRouteCollectionBuilder::__construct()` is deprecated since 3.2.0, expected structure is an array containing parameterized options. - */ - public function testFilterWithDeprecatedArgument(): void - { - $pathPattern = [ - '^/api/foo', - '^/api/bar', - ]; - - $routes = new RouteCollection(); - foreach ($this->getRoutes() as $name => $route) { - $routes->add($name, $route); - } - - $routeBuilder = new FilteredRouteCollectionBuilder( - $this->createControllerReflector(), - 'areaName', - $pathPattern - ); - $filteredRoutes = $routeBuilder->filter($routes); - - self::assertCount(5, $filteredRoutes); - } - /** * @param array $options */