Skip to content

Commit 95c5e41

Browse files
committed
Leverage str_starts_with(), str_ends_with() and str_contains()
1 parent 06984c9 commit 95c5e41

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Loader/YamlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function load(mixed $file, string $type = null): RouteCollection
7575
}
7676

7777
foreach ($parsedConfig as $name => $config) {
78-
if (0 === strpos($name, 'when@')) {
78+
if (str_starts_with($name, 'when@')) {
7979
if (!$this->env || 'when@'.$this->env !== $name) {
8080
continue;
8181
}

Route.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ private function sanitizeRequirement(string $key, string $regex)
433433
if ('' !== $regex) {
434434
if ('^' === $regex[0]) {
435435
$regex = substr($regex, 1);
436-
} elseif (0 === strpos($regex, '\\A')) {
436+
} elseif (str_starts_with($regex, '\\A')) {
437437
$regex = substr($regex, 2);
438438
}
439439
}

0 commit comments

Comments
 (0)