- 🇺🇸United States smustgrave
public function routeExists($name)
This needs to be typehinted both function and parameterpublic function routeExists($name)
Parameter needs typehintingAll instances of that outside the tests.
- Status changed to Needs review
about 2 years ago 4:20pm 28 July 2023 - last update
about 2 years ago 29,854 pass, 2 fail - 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
This adds type declarations and uses casting instead of
count()
to check whether the array is empty.If the merge request is to to used, I think the person who created the merge request needs to update its target branch to point to 11.x.
The last submitted patch, 34: drupal-create_routeExists-3029545-34.patch, failed testing. View results →
- last update
about 2 years ago 29,886 pass - Status changed to RTBC
about 2 years ago 4:43pm 2 August 2023 - 🇺🇸United States smustgrave
CR looks good, updated branch numbers.
Think this is a good addition.
- last update
about 2 years ago 29,946 pass - last update
about 2 years ago 29,953 pass - last update
about 2 years ago 29,941 pass, 2 fail The last submitted patch, 36: drupal-create_routeExists-3029545-36.patch, failed testing. View results →
- Assigned to nlisgo
- Status changed to Needs work
about 2 years ago 7:56am 7 August 2023 - last update
about 2 years ago 29,953 pass - Issue was unassigned.
- 🇬🇧United Kingdom nlisgo
Hitting retest to see if we can display a green run.
The random test failure has already been logged: 🐛 Random test fail in Drupal\Tests\Component\Utility\RandomTest::testRandomMachineNamesUniqueness Needs work
- Status changed to RTBC
about 2 years ago 9:21am 7 August 2023 - 🇬🇧United Kingdom nlisgo
Slight improvement, imo. Not a deal breaker for me.
public function routeExists(string $name): bool { return !empty($this->getRoutesByNames([$name])); }
Unless we anticipate a lot of calls to routeExists with an empty string then let's just assume the supplied string is a potential route and then explicitly declare true if not empty rather than casting.
- last update
about 2 years ago 29,958 pass - last update
about 2 years ago 29,958 pass - last update
almost 2 years ago 29,958 pass - last update
almost 2 years ago 29,959 pass - last update
almost 2 years ago 29,971 pass - last update
almost 2 years ago 30,049 pass - last update
almost 2 years ago 30,056 pass - last update
almost 2 years ago 30,056 pass - Status changed to Needs review
almost 2 years ago 7:21am 25 August 2023 - last update
almost 2 years ago 30,058 pass - 🇳🇿New Zealand quietone
I'm triaging RTBC issues → .
I read the Issue summary, comments and the change record. I found that all questions have been answered. The CR is complete and has a before and after section which makes it easy for the reader. It is a bit brief for my tastes but it does not require a change.
I looked at the patch and ran the tests.
-
+++ b/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php @@ -655,7 +655,7 @@ public function testRouteCaching() { + * Tests RouteProvider::getRouteByName(), RouteProvider::getRoutesByNames(), and RouteProvider::routeExists().
The summary line is to be 80 characters max. This could be changed by using @covers for the methods being tested.
-
+++ b/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php @@ -667,6 +667,11 @@ public function testRouteByName() { + $this->assertFalse($provider->routeExists(''));
And since a change is being made, this could use a simple comment to help the next person working on this.
I decided to make a patch for the above and at the same time I have added the suggestion in #42.
-
- Status changed to RTBC
almost 2 years ago 3:52pm 25 August 2023 - last update
almost 2 years ago 30,060 pass - last update
almost 2 years ago 30,063 pass - last update
almost 2 years ago 30,129 pass, 2 fail The last submitted patch, 43: 3029545-43.patch, failed testing. View results →
- last update
almost 2 years ago 29,482 pass - Merge request !12875Issue #3029545: Create method RouteProvider::routeExists() → (Open) created by Liam Morland
- 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
I have created a merge request with the patch in #43 targeting 11.x.
- 🇺🇸United States smustgrave
CR is outdated.
Also why does RouteProvider not implement RouteProvider Interface??
Issue summary also appears incomplete as this seems like an API change that probably can only go into a major as it would be an immediate break in a minor
- 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
RouteProvider
implementsCacheableRouteProviderInterface
which implementsRouteProviderInterface
.I suppose to prevent a breaking change to the API, the method could be added to the class but not the interface. The interface would then be updated with the next major release.