Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow class overriding #149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/Bramus/Router/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ class Router
/**
* @var array The route patterns and their handling functions
*/
private $afterRoutes = array();
protected $afterRoutes = array();

/**
* @var array The before middleware route patterns and their handling functions
*/
private $beforeRoutes = array();
protected $beforeRoutes = array();

/**
* @var object|callable The function to be executed when no route has been matched
Expand All @@ -30,22 +30,22 @@ class Router
/**
* @var string Current base route, used for (sub)route mounting
*/
private $baseRoute = '';
protected $baseRoute = '';

/**
* @var string The Request Method that needs to be handled
*/
private $requestedMethod = '';
protected $requestedMethod = '';

/**
* @var string The Server Base Path for Router Execution
*/
private $serverBasePath;
protected $serverBasePath;

/**
* @var string Default Controllers Namespace
*/
private $namespace = '';
protected $namespace = '';

/**
* Store a before middleware route and a handling function to be executed when accessed using one of the specified methods.
Expand Down Expand Up @@ -335,7 +335,7 @@ public function trigger404(){
*
* @return int The number of routes handled
*/
private function handle($routes, $quitAfterRun = false)
protected function handle($routes, $quitAfterRun = false)
{
// Counter to keep track of the number of routes we've handled
$numHandled = 0;
Expand Down Expand Up @@ -382,7 +382,7 @@ private function handle($routes, $quitAfterRun = false)
return $numHandled;
}

private function invoke($fn, $params = array())
protected function invoke($fn, $params = array())
{
if (is_callable($fn)) {
call_user_func_array($fn, $params);
Expand Down