@@ -22,19 +22,19 @@ discard block |
||
| 22 | 22 | * Route item can be defined using array key as an alias key. |
| 23 | 23 | * @var array |
| 24 | 24 | */ |
| 25 | - private $routes = []; |
|
| 25 | + private $routes = []; |
|
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * HTTP request Method |
| 29 | 29 | * @var string |
| 30 | 30 | */ |
| 31 | - private $method = null; |
|
| 31 | + private $method = null; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Request Uri |
| 35 | 35 | * @var string |
| 36 | 36 | */ |
| 37 | - private $requestedPath = null; |
|
| 37 | + private $requestedPath = null; |
|
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * Default return type if not noted in the $routes |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * @param string $requestedPath |
| 53 | 53 | * @param string $folder |
| 54 | 54 | */ |
| 55 | - public function __construct(array $routes, string $defaultReturnType, string $method, string $requestedPath, string $folder='') |
|
| 55 | + public function __construct(array $routes, string $defaultReturnType, string $method, string $requestedPath, string $folder = '') |
|
| 56 | 56 | { |
| 57 | 57 | $this->routes = $routes; |
| 58 | 58 | $this->method = $method; |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | if (!empty($folder)) { |
| 72 | 72 | $requestPath = '/' . trim(preg_replace('#^/' . $folder . '#msi', '/', $requestPath), "/"); |
| 73 | 73 | } |
| 74 | - if($requestPath == ''){ |
|
| 74 | + if ($requestPath == '') { |
|
| 75 | 75 | $requestPath = '/'; |
| 76 | 76 | } |
| 77 | 77 | return $requestPath; |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | $expected, |
| 71 | 71 | $result, |
| 72 | 72 | "extractFolder did not correctly extract the requested path for sub folder" |
| 73 | - ); |
|
| 73 | + ); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | public function extractFolderDataProvider() |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | $_POST = []; |
| 33 | 33 | $_SERVER = []; |
| 34 | 34 | $_COOKIE = []; |
| 35 | - $_SERVER['DOCUMENT_ROOT'] = $basedir."/htdocs"; |
|
| 35 | + $_SERVER['DOCUMENT_ROOT'] = $basedir . "/htdocs"; |
|
| 36 | 36 | $_SERVER['SCRIPT_NAME'] = '/index.php'; |
| 37 | 37 | $_SERVER['REQUEST_URI'] = '/alias'; |
| 38 | 38 | $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1'; |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $reflector = new ReflectionObject($router); |
| 66 | 66 | $method = $reflector->getMethod('extractFolder'); |
| 67 | 67 | $method->setAccessible(true); |
| 68 | - $result = $method->invoke($router, $requestedPath, $folder ); |
|
| 68 | + $result = $method->invoke($router, $requestedPath, $folder); |
|
| 69 | 69 | $this->assertEquals( |
| 70 | 70 | $expected, |
| 71 | 71 | $result, |
@@ -2,5 +2,5 @@ |
||
| 2 | 2 | namespace tests; |
| 3 | 3 | require_once dirname(__DIR__) . '/vendor/autoload.php'; |
| 4 | 4 | $loader = new \Composer\Autoload\ClassLoader(); |
| 5 | -$loader->add('test', dirname(__DIR__) ); |
|
| 5 | +$loader->add('test', dirname(__DIR__)); |
|
| 6 | 6 | $loader->register(); |