Skip to content

Commit 6780c9a

Browse files
committed
udpate some info
1 parent 5645e15 commit 6780c9a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Helper/RouteHelper.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static function isStaticRoute(string $route): bool
2727
/**
2828
* format URI path
2929
* @param string $path
30-
* @param bool $ignoreLastSlash
30+
* @param bool $ignoreLastSlash
3131
* @return string
3232
*/
3333
public static function formatPath(string $path, bool $ignoreLastSlash = true): string
@@ -38,7 +38,7 @@ public static function formatPath(string $path, bool $ignoreLastSlash = true): s
3838

3939
// clear '//', '///' => '/'
4040
if (false !== \strpos($path, '//')) {
41-
$path = (string)\preg_replace('#\/\/+#', '/', $path);
41+
$path = \preg_replace('#\/\/+#', '/', $path);
4242
}
4343

4444
// must be start withs '/'
@@ -62,7 +62,7 @@ public static function str2Camel(string $str): string
6262

6363
// convert 'first-second' to 'firstSecond'
6464
if (\strpos($str, '-')) {
65-
$str = (string)\preg_replace_callback('/-+([a-z])/', function ($c) {
65+
$str = \preg_replace_callback('/-+([a-z])/', function ($c) {
6666
return \strtoupper($c[1]);
6767
}, \trim($str, '- '));
6868
}
@@ -83,7 +83,7 @@ public static function parseAutoRoute(string $path, string $cnp, string $sfx)
8383

8484
// one node. eg: 'home'
8585
if (!\strpos($tmp, '/')) {
86-
$tmp = self::str2Camel($tmp);
86+
$tmp = self::str2Camel($tmp);
8787
$class = "$cnp\\" . \ucfirst($tmp) . $sfx;
8888

8989
return \class_exists($class) ? $class : false;
@@ -115,15 +115,15 @@ public static function parseAutoRoute(string $path, string $cnp, string $sfx)
115115
}
116116

117117
// last node is an controller class name
118-
$n2 = \array_pop($ary);
118+
$n2 = \array_pop($ary);
119119
$class = \sprintf('%s\\%s\\%s', $cnp, \implode('\\', $ary), \ucfirst($n2) . $sfx);
120120

121121
if (\class_exists($class)) {
122122
return $class;
123123
}
124124

125125
// last second is an controller class name, last node is a action name,
126-
$n1 = \array_pop($ary);
126+
$n1 = \array_pop($ary);
127127
$class = \sprintf('%s\\%s\\%s', $cnp, \implode('\\', $ary), \ucfirst($n1) . $sfx);
128128

129129
return \class_exists($class) ? "$class@$n2" : false;
@@ -135,7 +135,7 @@ public static function parseAutoRoute(string $path, string $cnp, string $sfx)
135135
* array - [class, method]
136136
* object - Closure, Object
137137
*
138-
* @param array $args
138+
* @param array $args
139139
* @return mixed
140140
* @throws \InvalidArgumentException
141141
*/

src/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public function add(string $method, string $path, $handler, array $binds = [], a
257257

258258
if ($method === 'ANY') {
259259
$this->any($path, $handler, $binds, $opts);
260-
return Route::createFromArray([]);
260+
return Route::createFromArray();
261261
}
262262

263263
if (false === \strpos(self::METHODS_STRING, ',' . $method . ',')) {

0 commit comments

Comments
 (0)