mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 10:52:13 +00:00
Added support for PHP7
This commit is contained in:
+8
-3
@@ -19,6 +19,7 @@ use Pecee\SimpleRouter\SimpleRouter as Router;
|
||||
* @param array|null $getParams
|
||||
* @return string
|
||||
* @throws \InvalidArgumentException
|
||||
* @throws \Pecee\Http\Exceptions\MalformedUrlException
|
||||
*/
|
||||
function url($name = null, $parameters = null, $getParams = null)
|
||||
{
|
||||
@@ -27,6 +28,7 @@ function url($name = null, $parameters = null, $getParams = null)
|
||||
|
||||
/**
|
||||
* @return \Pecee\Http\Response
|
||||
* @throws \Pecee\Http\Exceptions\MalformedUrlException
|
||||
*/
|
||||
function response()
|
||||
{
|
||||
@@ -35,6 +37,7 @@ function response()
|
||||
|
||||
/**
|
||||
* @return \Pecee\Http\Request
|
||||
* @throws \Pecee\Http\Exceptions\MalformedUrlException
|
||||
*/
|
||||
function request()
|
||||
{
|
||||
@@ -46,15 +49,16 @@ function request()
|
||||
* @param string|null $index Parameter index name
|
||||
* @param string|null $defaultValue Default return value
|
||||
* @param string|array|null $methods Default method
|
||||
* @return \Pecee\Http\Input\Input|string
|
||||
* @return \Pecee\Http\Input\InputHandler|string
|
||||
* @throws \Pecee\Http\Exceptions\MalformedUrlException
|
||||
*/
|
||||
function input($index = null, $defaultValue = null, $methods = null)
|
||||
{
|
||||
if ($index !== null) {
|
||||
return request()->getInput()->get($index, $defaultValue, $methods);
|
||||
return request()->getInputHandler()->get($index, $defaultValue, $methods);
|
||||
}
|
||||
|
||||
return request()->getInput();
|
||||
return request()->getInputHandler();
|
||||
}
|
||||
|
||||
function redirect($url, $code = null)
|
||||
@@ -69,6 +73,7 @@ function redirect($url, $code = null)
|
||||
/**
|
||||
* Get current csrf-token
|
||||
* @return string|null
|
||||
* @throws \Pecee\Http\Exceptions\MalformedUrlException
|
||||
*/
|
||||
function csrf_token()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user