Skip to content

Commit 71435d1

Browse files
authored
make private methods protected instead (#18)
1 parent 92db465 commit 71435d1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Nono/Application.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function run()
141141
* @param array $params
142142
* @throws \Exception
143143
*/
144-
private function call($action, $params)
144+
protected function call($action, $params)
145145
{
146146
if ($action instanceof \Closure) {
147147
$action(...$params);
@@ -162,7 +162,7 @@ private function call($action, $params)
162162
*
163163
* @param \Exception $e
164164
*/
165-
private function handleException(\Exception $e)
165+
protected function handleException(\Exception $e)
166166
{
167167
echo $e->getMessage();
168168
}

src/Nono/Router.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function route($verb, $uri)
6969
* @var string $verb
7070
* @return array
7171
*/
72-
private function routes($verb)
72+
protected function routes($verb)
7373
{
7474
return isset($this->routes[$verb]) ? $this->routes[$verb] : [];
7575
}
@@ -83,7 +83,7 @@ private function routes($verb)
8383
* @param array $routes
8484
* @return array
8585
*/
86-
private function match($uri, $routes)
86+
protected function match($uri, $routes)
8787
{
8888
if (!preg_match($this->combine($routes), $uri, $m)) {
8989
return [];
@@ -105,7 +105,7 @@ private function match($uri, $routes)
105105
* @var string $str
106106
* @return string
107107
*/
108-
private function pattern($str)
108+
protected function pattern($str)
109109
{
110110
return preg_replace('~\{([a-zA-Z0-9]+)\}~', '([^/]+)', $str);
111111
}
@@ -119,7 +119,7 @@ private function pattern($str)
119119
* @var array $routes
120120
* @return string
121121
*/
122-
private function combine($routes)
122+
protected function combine($routes)
123123
{
124124
$str = $mark = '';
125125
foreach ($routes as $id => $data) {

0 commit comments

Comments
 (0)