diff --git a/src/Dispatcher/AbstractDispatchableController.php b/src/Dispatcher/AbstractDispatchableController.php index e9c60eb..98c584c 100644 --- a/src/Dispatcher/AbstractDispatchableController.php +++ b/src/Dispatcher/AbstractDispatchableController.php @@ -14,12 +14,12 @@ abstract class AbstractDispatchableController implements Interfaces\Dispatchable use DiAwareTrait; use RouteAwareTrait; - function __construct( $di, $route ){ + public function __construct( $di, $route ){ $this->setDi($di); $this->setRoute($route); } - function __invoke(){ + public function __invoke(){ $action = $this->getRoute()->getAction(); if(method_exists($this, $action)){ diff --git a/src/Dispatcher/Interfaces/DispatchableInterface.php b/src/Dispatcher/Interfaces/DispatchableInterface.php index c9a7837..e41d107 100644 --- a/src/Dispatcher/Interfaces/DispatchableInterface.php +++ b/src/Dispatcher/Interfaces/DispatchableInterface.php @@ -16,12 +16,12 @@ interface DispatchableInterface { * @param RouteInterface $route The Route * @return void */ - function __construct( $di, $route ); + public function __construct( $di, $route ); /** * make our object dispatchable * @return mixed */ - function __invoke(); + public function __invoke(); } diff --git a/src/Dispatcher/Interfaces/DispatcherInterface.php b/src/Dispatcher/Interfaces/DispatcherInterface.php index 1dadd54..bf56d2c 100644 --- a/src/Dispatcher/Interfaces/DispatcherInterface.php +++ b/src/Dispatcher/Interfaces/DispatcherInterface.php @@ -17,6 +17,6 @@ interface DispatcherInterface { * @param string $path The path to parse * @return \Closure */ - function dispatch( RouteInterface $route ); + public function dispatch( RouteInterface $route ); } diff --git a/src/Response/Interfaces/HeadersInterface.php b/src/Response/Interfaces/HeadersInterface.php index 2b59e20..bc5a25f 100644 --- a/src/Response/Interfaces/HeadersInterface.php +++ b/src/Response/Interfaces/HeadersInterface.php @@ -11,7 +11,7 @@ interface HeadersInterface { /** * @return array */ - function getHeaders(); + public function getHeaders(); /** * @todo array values, separated with semicolons and comas dependent on their depth @@ -20,7 +20,7 @@ function getHeaders(); * @param string $value * @return string The Composed Header */ - function setHeader( $key, $value ); + public function setHeader( $key, $value ); /** * Method to generate the correct content-type header for the response @@ -28,7 +28,7 @@ function setHeader( $key, $value ); * @param string $extension The type to retrieve * @return string */ - function setContentType( $extension ); + public function setContentType( $extension ); /** * @param string $url @@ -36,7 +36,7 @@ function setContentType( $extension ); * @return void * @throws \Exception */ - function setRedirect( $url, $statusCode = 302 ); + public function setRedirect( $url, $statusCode = 302 ); /** * method to to generate the correct HTTP header for the response @@ -45,13 +45,13 @@ function setRedirect( $url, $statusCode = 302 ); * @return string * @throws \Exception */ - function setStatusCode( $statusCode ); + public function setStatusCode( $statusCode ); /** * @param callable $callback * @param bool $extra * @return void */ - function eachHeader( callable $callback, $extra = false ); + public function eachHeader( callable $callback, $extra = false ); } diff --git a/src/Response/Traits/ContentTypeAwareTrait.php b/src/Response/Traits/ContentTypeAwareTrait.php index d28e7df..7430d93 100644 --- a/src/Response/Traits/ContentTypeAwareTrait.php +++ b/src/Response/Traits/ContentTypeAwareTrait.php @@ -32,6 +32,6 @@ public function setContentType( $extension ) { * @param string $k * @param string $v */ - abstract function setHeader($k, $v); + public abstract function setHeader($k, $v); } diff --git a/src/Response/Traits/RedirectAwareTrait.php b/src/Response/Traits/RedirectAwareTrait.php index 5d6fe3f..1b52295 100644 --- a/src/Response/Traits/RedirectAwareTrait.php +++ b/src/Response/Traits/RedirectAwareTrait.php @@ -23,11 +23,11 @@ public function setRedirect( $url, $statusCode = 302 ) { * @param string $k * @param string $v */ - abstract function setHeader($k, $v); + public abstract function setHeader($k, $v); /** * @param string $v */ - abstract function setStatusCode($v); + public abstract function setStatusCode($v); } diff --git a/src/Router/AbstractRouter.php b/src/Router/AbstractRouter.php index 6bc1d5a..8df7e2a 100644 --- a/src/Router/AbstractRouter.php +++ b/src/Router/AbstractRouter.php @@ -18,7 +18,7 @@ abstract class AbstractRouter { /** * set the default action */ - function setDefaultAction($action){ + public function setDefaultAction($action){ $this->default_action = $action; } @@ -30,7 +30,7 @@ function setDefaultAction($action){ /** * set the default format */ - function setDefaultFormat($format){ + public function setDefaultFormat($format){ $this->default_format = $format; } diff --git a/src/Router/BasicRouter.php b/src/Router/BasicRouter.php index a8879e3..a4a5935 100644 --- a/src/Router/BasicRouter.php +++ b/src/Router/BasicRouter.php @@ -29,7 +29,7 @@ class BasicRouter extends AbstractRouter implements Interfaces\RouterInterface { * @param string $path A string representing the path to be parsed -- $_SERVER[REQUEST_URI] * @return Route */ - function match($path){ + public function match($path){ list($controller, $action, $format, $parameters) = $this->parseRequest($path); return new Route($controller, $action, $format, $parameters); } diff --git a/src/Router/Interfaces/RouterInterface.php b/src/Router/Interfaces/RouterInterface.php index baf6429..7d8580e 100644 --- a/src/Router/Interfaces/RouterInterface.php +++ b/src/Router/Interfaces/RouterInterface.php @@ -14,6 +14,6 @@ interface RouterInterface { * @param string $path The path to parse * @return \Chevron\Kernel\Router\Route */ - function match($path); + public function match($path); } diff --git a/src/Router/RegexRouter.php b/src/Router/RegexRouter.php index b1e4fc8..f9d7b25 100644 --- a/src/Router/RegexRouter.php +++ b/src/Router/RegexRouter.php @@ -22,7 +22,7 @@ class RegexRouter extends AbstractRouter implements Interfaces\RouterInterface { * @param string $path A string representing the path to be parsed -- $_SERVER[REQUEST_URI] * @return mixed */ - function match($path){ + public function match($path){ if(!$this->patterns){ return null; } foreach($this->patterns as $regex => $controller){ @@ -39,7 +39,7 @@ function match($path){ * @param callable $func The callable 'controller' * @return void */ - function regex($pattern, callable $func){ + public function regex($pattern, callable $func){ $this->patterns[$pattern] = $func; } diff --git a/src/Router/Route.php b/src/Router/Route.php index 5d628bc..8775c3a 100644 --- a/src/Router/Route.php +++ b/src/Router/Route.php @@ -47,7 +47,7 @@ class Route implements Interfaces\RouteInterface{ * @param array array $params an array of the parsed query string * @return \Chevron\Router\Route */ - function __construct($controller, $action = null, $format = null, array $params = []){ + public function __construct($controller, $action = null, $format = null, array $params = []){ $this->controller = $controller ?: self::DEFAULT_CONTROLLER; if($action){ @@ -68,7 +68,7 @@ function __construct($controller, $action = null, $format = null, array $params * get the controller * @return string */ - function getController(){ + public function getController(){ return $this->controller; } @@ -76,7 +76,7 @@ function getController(){ * get the action * @return string */ - function getAction(){ + public function getAction(){ return $this->action; } @@ -84,7 +84,7 @@ function getAction(){ * get the format * @return string */ - function getFormat(){ + public function getFormat(){ return $this->format; } @@ -92,14 +92,14 @@ function getFormat(){ * get the params * @return array */ - function getParams(){ + public function getParams(){ return $this->params; } /** * get a unique 8 char hash of the request */ - function getHash(){ + public function getHash(){ return substr(sha1($this->__toString()), 0, 8); } @@ -107,7 +107,7 @@ function getHash(){ * output the route as an array * @return array */ - function toArray(){ + public function toArray(){ return [ static::CONTROLLER_KEY => $this->getController(), static::ACTION_KEY => $this->getAction(), @@ -118,7 +118,7 @@ function toArray(){ /** * create a link looking string from the properties of the route */ - function __toString(){ + public function __toString(){ $route = strtolower(strtr(trim($this->getController(), DIRECTORY_SEPARATOR), "\\", "/")) . "/"; @@ -142,7 +142,7 @@ function __toString(){ * chance that you're dispatching from a specific namespace * @param string $namespace The prefix for the link */ - function link($namespace = ""){ + public function link($namespace = ""){ $prefix = ""; if($namespace){ $prefix = strtolower(trim($namespace, "\\/")); @@ -156,7 +156,7 @@ function link($namespace = ""){ * @param string $action * @return string */ - function setAction($action){ + public function setAction($action){ $this->action = $action; } @@ -165,7 +165,7 @@ function setAction($action){ * @param string $format * @return string */ - function setFormat($format){ + public function setFormat($format){ $this->format = $format; } @@ -174,8 +174,8 @@ function setFormat($format){ * @param array $params * @return array */ - function setParams(array $params){ + public function setParams(array $params){ $this->params = $params; } -} \ No newline at end of file +}