From 5df0c128641d0a734e0bba9c8df5f7aeed153319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sessing=C3=B8?= Date: Fri, 30 Mar 2018 05:54:12 +0200 Subject: [PATCH 1/2] Updated helpers --- .idea/workspace.xml | 83 ++++++++++++++++++++++++++++----------------- README.md | 2 +- helpers.php | 2 +- 3 files changed, 53 insertions(+), 34 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 97854c5..1e9ac9b 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,8 @@ - + + @@ -487,7 +503,7 @@ - + @@ -524,7 +540,7 @@ - @@ -544,11 +560,11 @@ - + - + @@ -814,16 +830,6 @@ - - - - - - - - - - @@ -835,13 +841,6 @@ - - - - - - - @@ -882,8 +881,28 @@ - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md index 0592ed9..16aa41c 100644 --- a/README.md +++ b/README.md @@ -332,7 +332,7 @@ function request(): Request * @param string|null $index Parameter index name * @param string|null $defaultValue Default return value * @param array ...$methods Default methods - * @return \Pecee\Http\Input\InputHandler|\Pecee\Http\Input\IInputItem|string + * @return \Pecee\Http\Input\InputHandler|string */ function input($index = null, $defaultValue = null, ...$methods) { diff --git a/helpers.php b/helpers.php index 264df05..00ffa4b 100644 --- a/helpers.php +++ b/helpers.php @@ -49,7 +49,7 @@ function request(): Request * @param string|null $index Parameter index name * @param string|null $defaultValue Default return value * @param array ...$methods Default methods - * @return \Pecee\Http\Input\InputHandler|\Pecee\Http\Input\IInputItem|string + * @return \Pecee\Http\Input\InputHandler|string */ function input($index = null, $defaultValue = null, ...$methods) { From 53f0b7d8e23e895f1a056c08f6d18e41ddbb40f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sessing=C3=B8?= Date: Fri, 30 Mar 2018 06:47:27 +0200 Subject: [PATCH 2/2] - Fixed `getName` method in `LoadableRoute` class can contain nullable value. --- .idea/workspace.xml | 192 +++++++++++------- .../SimpleRouter/Route/LoadableRoute.php | 2 +- src/Pecee/SimpleRouter/Route/Route.php | 2 +- 3 files changed, 120 insertions(+), 76 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 1e9ac9b..1da4204 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,8 +2,9 @@ - - + + + - - - - - - - - - - - - - - - + + - + - + - - - - - + + - - - - - + + + + + + + + + + + + + + + + + + + + @@ -69,7 +69,7 @@ - + @@ -78,7 +78,7 @@ - + @@ -87,7 +87,7 @@ - + @@ -97,7 +97,7 @@ - + @@ -115,7 +115,6 @@ - renderRoute findRoute ->fireEvents RENDER_MIDD @@ -145,19 +144,20 @@ (int) setSize helpers.php + getName D:\Workspace\simple-php-router\src\Pecee\SimpleRouter\Route D:\Workspace\simple-php-router\src D:\Workspace\simple-php-router\tests\Pecee\SimpleRouter\Dummy D:\Workspace\simple-php-router - E:\Workspace\simple-php-router\src\Pecee\SimpleRouter\Route E:\Workspace\simple-php-router\tests E:\Workspace\simple-php-router\src\Pecee E:\Workspace\simple-php-router E:\Workspace\simple-php-router\src\Pecee\SimpleRouter E:\Workspace\simple-php-router\tests\Pecee\SimpleRouter E:\Workspace\simple-php-router\src + E:\Workspace\simple-php-router\src\Pecee\SimpleRouter\Route @@ -200,8 +200,6 @@ @@ -277,8 +277,8 @@ - @@ -346,6 +346,14 @@ + + + + + + + + @@ -503,7 +511,8 @@ - + + @@ -540,7 +549,7 @@ - @@ -560,8 +569,8 @@ - - + + @@ -590,6 +599,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -637,13 +684,6 @@ - - - - - - - @@ -745,13 +785,6 @@ - - - - - - - @@ -767,13 +800,6 @@ - - - - - - - @@ -853,7 +879,7 @@ - + @@ -867,14 +893,14 @@ - + - + @@ -882,29 +908,47 @@ - + - - + + - + - - - + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Pecee/SimpleRouter/Route/LoadableRoute.php b/src/Pecee/SimpleRouter/Route/LoadableRoute.php index 9fc4cb3..a719af7 100644 --- a/src/Pecee/SimpleRouter/Route/LoadableRoute.php +++ b/src/Pecee/SimpleRouter/Route/LoadableRoute.php @@ -154,7 +154,7 @@ abstract class LoadableRoute extends Route implements ILoadableRoute * * @return string */ - public function getName(): string + public function getName(): ?string { return $this->name; } diff --git a/src/Pecee/SimpleRouter/Route/Route.php b/src/Pecee/SimpleRouter/Route/Route.php index ad56adc..c71686c 100644 --- a/src/Pecee/SimpleRouter/Route/Route.php +++ b/src/Pecee/SimpleRouter/Route/Route.php @@ -192,7 +192,7 @@ abstract class Route implements IRoute return $this->callback; } - return 'function_' . md5($this->callback); + return 'function:' . md5($this->callback); } /**