From 3f625bc5e147e028445196ac28145d4501bfa897 Mon Sep 17 00:00:00 2001 From: Stoyan Kyosev Date: Tue, 14 Jul 2015 15:19:21 +0300 Subject: [PATCH] Increase method visibility I really don't see a reason why the method of this class should be private. There are some realistic cases for extending the class and overriding some functionalities. For example I would want to throw events at some points from the dispatch cycle. The only solutions for me are to replace the whole class (pretty ugly) or modify the source code directly (renders composer useless). Best Regards --- src/Phroute/Dispatcher.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Phroute/Dispatcher.php b/src/Phroute/Dispatcher.php index 6e637e5..cefdf27 100644 --- a/src/Phroute/Dispatcher.php +++ b/src/Phroute/Dispatcher.php @@ -67,7 +67,7 @@ public function dispatch($httpMethod, $uri) * @param null $response * @return mixed|null */ - private function dispatchFilters($filters, $response = null) + protected function dispatchFilters($filters, $response = null) { while($filter = array_shift($filters)) { @@ -88,7 +88,7 @@ private function dispatchFilters($filters, $response = null) * @param $filters * @return array */ - private function parseFilters($filters) + protected function parseFilters($filters) { $beforeFilter = array(); $afterFilter = array(); @@ -113,7 +113,7 @@ private function parseFilters($filters) * @param $uri * @throws Exception\HttpRouteNotFoundException */ - private function dispatchRoute($httpMethod, $uri) + protected function dispatchRoute($httpMethod, $uri) { if (isset($this->staticRouteMap[$uri])) { @@ -131,7 +131,7 @@ private function dispatchRoute($httpMethod, $uri) * @return mixed * @throws Exception\HttpMethodNotAllowedException */ - private function dispatchStaticRoute($httpMethod, $uri) + protected function dispatchStaticRoute($httpMethod, $uri) { $routes = $this->staticRouteMap[$uri]; @@ -150,7 +150,7 @@ private function dispatchStaticRoute($httpMethod, $uri) * @param $httpMethod * @throws Exception\HttpMethodNotAllowedException */ - private function checkFallbacks($routes, $httpMethod) + protected function checkFallbacks($routes, $httpMethod) { $additional = array(Route::ANY); @@ -180,7 +180,7 @@ private function checkFallbacks($routes, $httpMethod) * @throws Exception\HttpMethodNotAllowedException * @throws Exception\HttpRouteNotFoundException */ - private function dispatchVariableRoute($httpMethod, $uri) + protected function dispatchVariableRoute($httpMethod, $uri) { foreach ($this->variableRouteData as $data) {