Skip to content

Commit 941149d

Browse files
committed
Fixed deprication warnings
1 parent 1764b67 commit 941149d

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- 7.4
2121
- 8.0
2222
phpunit-version:
23-
- 7.5.20
23+
- 8.5.32
2424
dependencies:
2525
- lowest
2626
- highest

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"ext-json": "*"
3232
},
3333
"require-dev": {
34-
"phpunit/phpunit": "^7",
34+
"phpunit/phpunit": "^8",
3535
"mockery/mockery": "^1",
3636
"phpstan/phpstan": "^0",
3737
"phpstan/phpstan-phpunit": "^0",

src/Pecee/SimpleRouter/Route/LoadableRoute.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public function findUrl(?string $method = null, $parameters = null, ?string $nam
167167

168168
if (stripos($url, $param1) !== false || stripos($url, $param) !== false) {
169169
/* Add parameter to the correct position */
170-
$url = str_ireplace([sprintf($param1, $param), sprintf($param2, $param)], $value, $url);
170+
$url = str_ireplace([sprintf($param1, $param), sprintf($param2, $param)], (string)$value, $url);
171171
} else {
172172
/* Parameter aren't recognized and will be appended at the end of the url */
173173
$url .= $value . '/';

src/Pecee/SimpleRouter/Route/RouteController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function findUrl(?string $method = null, $parameters = null, ?string $nam
8181
$url .= '//' . $group->getDomains()[0];
8282
}
8383

84-
$url .= '/' . trim($this->getUrl(), '/') . '/' . strtolower($method) . implode('/', $parameters);
84+
$url .= '/' . trim($this->getUrl(), '/') . '/' . strtolower((string)$method) . implode('/', $parameters);
8585

8686
return '/' . trim($url, '/') . '/';
8787
}

src/Pecee/SimpleRouter/Route/RouteGroup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function matchRoute(string $url, Request $request): bool
7474
$parsedPrefix = $this->prefix;
7575

7676
foreach ($this->getParameters() as $parameter => $value) {
77-
$parsedPrefix = str_ireplace('{' . $parameter . '}', $value, $parsedPrefix);
77+
$parsedPrefix = str_ireplace('{' . $parameter . '}', (string)$value, (string)$parsedPrefix);
7878
}
7979

8080
/* Skip if prefix doesn't match */

src/Pecee/SimpleRouter/Route/RouteResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function matchRoute(string $url, Request $request): bool
106106
return false;
107107
}
108108

109-
$action = strtolower(trim($this->parameters['action']));
109+
$action = strtolower(trim((string)$this->parameters['action']));
110110
$id = $this->parameters['id'];
111111

112112
// Remove action parameter

src/Pecee/SimpleRouter/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ public function findRoute(string $name): ?ILoadableRoute
608608
if (strpos($name, '@') !== false) {
609609
[$controller, $method] = array_map('strtolower', explode('@', $name));
610610

611-
if ($controller === strtolower($route->getClass()) && $method === strtolower($route->getMethod())) {
611+
if ($controller === strtolower((string)$route->getClass()) && $method === strtolower((string)$route->getMethod())) {
612612
$this->debug('Found route "%s" by controller "%s" and method "%s"', $route->getUrl(), $controller, $method);
613613

614614
return $route;

0 commit comments

Comments
 (0)