Skip to content

Commit 210bbae

Browse files
[Routing] Simplify importing routes defined on controller services
1 parent 28a70b1 commit 210bbae

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

Loader/AttributeServicesLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ public function load(mixed $resource, ?string $type = null): RouteCollection
4242

4343
public function supports(mixed $resource, ?string $type = null): bool
4444
{
45-
return 'tagged_services' === $type && 'attributes' === $resource;
45+
return 'routing.controllers' === $resource;
4646
}
4747
}

Loader/Configurator/RoutesReference.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
*
2727
* return Routes::config([
2828
* 'controllers' => [
29-
* 'resource' => 'attributes',
30-
* 'type' => 'tagged_services',
29+
* 'resource' => 'routing.controllers',
3130
* ],
3231
* ]);
3332
* ```

Tests/Loader/AttributeServicesLoaderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public function testSupports()
2626

2727
$this->assertFalse($loader->supports('attributes', null));
2828
$this->assertFalse($loader->supports('attributes', 'attribute'));
29-
$this->assertFalse($loader->supports('other', 'tagged_services'));
30-
$this->assertTrue($loader->supports('attributes', 'tagged_services'));
29+
$this->assertFalse($loader->supports('other', 'routing.controllers'));
30+
$this->assertTrue($loader->supports('routing.controllers'));
3131
}
3232

3333
public function testDelegatesToAttributeLoaderAndMergesCollections()
@@ -47,7 +47,7 @@ public function testDelegatesToAttributeLoaderAndMergesCollections()
4747
$attributeLoader->setResolver($resolver);
4848
$servicesLoader->setResolver($resolver);
4949

50-
$collection = $servicesLoader->load('attributes', 'tagged_services');
50+
$collection = $servicesLoader->load('routing.controllers');
5151

5252
$this->assertArrayHasKey('action', $collection->all());
5353
$this->assertArrayHasKey('put', $collection->all());

0 commit comments

Comments
 (0)