Skip to content
This repository was archived by the owner on Mar 8, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Active.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public function checkRoute($routeNames)
*
* @return bool
*/
public function checkRoutePattern($patterns)
public function checkRoutePattern($patterns): bool
{
if (!$this->route) {
return false;
Expand All @@ -227,7 +227,7 @@ public function checkRoutePattern($patterns)
$routeName = $this->route->getName();

if ($routeName == null) {
return in_array(null, $patterns);
return in_array(null, (array) $patterns);
}

foreach ((array)$patterns as $p) {
Expand Down
5 changes: 5 additions & 0 deletions tests/ActiveTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,11 @@ public function provideCheckRoutePatternTestData()
['foo.*', null],
true,
],
'route with no name and single pattern' => [
Request::create('/'),
'foo.*',
false,
],
];
}

Expand Down