@@ -9,8 +9,7 @@ discard block |
||
| 9 | 9 | * |
| 10 | 10 | * @package Zortje\MVC\Model\Table\Exception |
| 11 | 11 | */ |
| 12 | -class TableNameNotDefinedException extends Exception |
|
| 13 | -{ |
|
| 12 | +class TableNameNotDefinedException extends Exception { |
|
| 14 | 13 | |
| 15 | 14 | /** |
| 16 | 15 | * {@inheritdoc} |
@@ -20,8 +19,7 @@ discard block |
||
| 20 | 19 | /** |
| 21 | 20 | * {@inheritdoc} |
| 22 | 21 | */ |
| 23 | - public function __construct($message) |
|
| 24 | - { |
|
| 22 | + public function __construct($message) { |
|
| 25 | 23 | parent::__construct($message); |
| 26 | 24 | } |
| 27 | 25 | } |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | * |
| 10 | 10 | * @package Zortje\MVC\Model |
| 11 | 11 | */ |
| 12 | -class User extends Entity |
|
| 13 | -{ |
|
| 12 | +class User extends Entity { |
|
| 14 | 13 | |
| 15 | 14 | } |
@@ -7,8 +7,7 @@ discard block |
||
| 7 | 7 | * |
| 8 | 8 | * @package Zortje\MVC\Network |
| 9 | 9 | */ |
| 10 | -class Request |
|
| 11 | -{ |
|
| 10 | +class Request { |
|
| 12 | 11 | |
| 13 | 12 | /** |
| 14 | 13 | * @var string Full URL |
@@ -25,8 +24,7 @@ discard block |
||
| 25 | 24 | * |
| 26 | 25 | * @return string URL path |
| 27 | 26 | */ |
| 28 | - public function getPath() |
|
| 29 | - { |
|
| 27 | + public function getPath() { |
|
| 30 | 28 | $path = parse_url($this->url, PHP_URL_PATH); |
| 31 | 29 | |
| 32 | 30 | if ($path === false) { |
@@ -40,8 +38,7 @@ discard block |
||
| 40 | 38 | * @param string $url URL of the request, trailing slash are removed automatically |
| 41 | 39 | * @param array $post URL post fields |
| 42 | 40 | */ |
| 43 | - public function __construct($url, array $post) |
|
| 44 | - { |
|
| 41 | + public function __construct($url, array $post) { |
|
| 45 | 42 | $this->url = rtrim($url, '/'); |
| 46 | 43 | $this->post = $post; |
| 47 | 44 | } |
@@ -7,8 +7,7 @@ discard block |
||
| 7 | 7 | * |
| 8 | 8 | * @package Zortje\MVC\Network |
| 9 | 9 | */ |
| 10 | -class Response |
|
| 11 | -{ |
|
| 10 | +class Response { |
|
| 12 | 11 | |
| 13 | 12 | /** |
| 14 | 13 | * @var array HTTP headers |
@@ -23,8 +22,7 @@ discard block |
||
| 23 | 22 | /** |
| 24 | 23 | * @return array |
| 25 | 24 | */ |
| 26 | - public function output() |
|
| 27 | - { |
|
| 25 | + public function output() { |
|
| 28 | 26 | return [ |
| 29 | 27 | 'headers' => $this->headers, |
| 30 | 28 | 'output' => $this->output |
@@ -35,8 +33,7 @@ discard block |
||
| 35 | 33 | * @param array $headers |
| 36 | 34 | * @param string $output |
| 37 | 35 | */ |
| 38 | - public function __construct($headers, $output) |
|
| 39 | - { |
|
| 36 | + public function __construct($headers, $output) { |
|
| 40 | 37 | $this->headers = $headers; |
| 41 | 38 | $this->output = $output; |
| 42 | 39 | } |
@@ -20,8 +20,7 @@ discard block |
||
| 20 | 20 | * |
| 21 | 21 | * @package Zortje\MVC\Routing |
| 22 | 22 | */ |
| 23 | -class Dispatcher |
|
| 24 | -{ |
|
| 23 | +class Dispatcher { |
|
| 25 | 24 | |
| 26 | 25 | /** |
| 27 | 26 | * @var Router |
@@ -53,8 +52,7 @@ discard block |
||
| 53 | 52 | * |
| 54 | 53 | * @param Logger $logger |
| 55 | 54 | */ |
| 56 | - public function setLogger(Logger $logger) |
|
| 57 | - { |
|
| 55 | + public function setLogger(Logger $logger) { |
|
| 58 | 56 | $this->logger = $logger; |
| 59 | 57 | } |
| 60 | 58 | |
@@ -65,8 +63,7 @@ discard block |
||
| 65 | 63 | * |
| 66 | 64 | * @throws \Exception If unexpected exception is thrown |
| 67 | 65 | */ |
| 68 | - public function dispatch(Request $request) |
|
| 69 | - { |
|
| 66 | + public function dispatch(Request $request) { |
|
| 70 | 67 | $controllerFactory = new ControllerFactory($this->pdo, $this->appPath, $this->user); |
| 71 | 68 | |
| 72 | 69 | try { |
@@ -190,8 +187,7 @@ discard block |
||
| 190 | 187 | * @param string $appPath |
| 191 | 188 | * @param null|User $user |
| 192 | 189 | */ |
| 193 | - public function __construct(Router $router, \PDO $pdo, $appPath, User $user = null) |
|
| 194 | - { |
|
| 190 | + public function __construct(Router $router, \PDO $pdo, $appPath, User $user = null) { |
|
| 195 | 191 | $this->router = $router; |
| 196 | 192 | $this->pdo = $pdo; |
| 197 | 193 | $this->appPath = $appPath; |
@@ -9,8 +9,7 @@ discard block |
||
| 9 | 9 | * |
| 10 | 10 | * @package Zortje\MVC\Routing\Exception |
| 11 | 11 | */ |
| 12 | -class RouteAlreadyConnectedException extends Exception |
|
| 13 | -{ |
|
| 12 | +class RouteAlreadyConnectedException extends Exception { |
|
| 14 | 13 | |
| 15 | 14 | /** |
| 16 | 15 | * {@inheritdoc} |
@@ -20,8 +19,7 @@ discard block |
||
| 20 | 19 | /** |
| 21 | 20 | * {@inheritdoc} |
| 22 | 21 | */ |
| 23 | - public function __construct($message) |
|
| 24 | - { |
|
| 22 | + public function __construct($message) { |
|
| 25 | 23 | parent::__construct($message); |
| 26 | 24 | } |
| 27 | 25 | } |
@@ -9,8 +9,7 @@ discard block |
||
| 9 | 9 | * |
| 10 | 10 | * @package Zortje\MVC\Routing\Exception |
| 11 | 11 | */ |
| 12 | -class RouteNonexistentException extends Exception |
|
| 13 | -{ |
|
| 12 | +class RouteNonexistentException extends Exception { |
|
| 14 | 13 | |
| 15 | 14 | /** |
| 16 | 15 | * {@inheritdoc} |
@@ -20,8 +19,7 @@ discard block |
||
| 20 | 19 | /** |
| 21 | 20 | * {@inheritdoc} |
| 22 | 21 | */ |
| 23 | - public function __construct($message) |
|
| 24 | - { |
|
| 22 | + public function __construct($message) { |
|
| 25 | 23 | parent::__construct($message); |
| 26 | 24 | } |
| 27 | 25 | } |
@@ -10,8 +10,7 @@ discard block |
||
| 10 | 10 | * |
| 11 | 11 | * @package Zortje\MVC\Routing |
| 12 | 12 | */ |
| 13 | -class Router |
|
| 14 | -{ |
|
| 13 | +class Router { |
|
| 15 | 14 | |
| 16 | 15 | /** |
| 17 | 16 | * @var array Routes |
@@ -27,8 +26,7 @@ discard block |
||
| 27 | 26 | * |
| 28 | 27 | * @throws RouteAlreadyConnectedException When route is already connected |
| 29 | 28 | */ |
| 30 | - public function connect($route, $controller, $action) |
|
| 31 | - { |
|
| 29 | + public function connect($route, $controller, $action) { |
|
| 32 | 30 | if (isset($this->routes[$route]) === true) { |
| 33 | 31 | throw new RouteAlreadyConnectedException([$route]); |
| 34 | 32 | } |
@@ -48,8 +46,7 @@ discard block |
||
| 48 | 46 | * |
| 49 | 47 | * @throws RouteNonexistentException When route is not connected |
| 50 | 48 | */ |
| 51 | - public function route($route) |
|
| 52 | - { |
|
| 49 | + public function route($route) { |
|
| 53 | 50 | if (isset($this->routes[$route]) === false) { |
| 54 | 51 | throw new RouteNonexistentException([$route]); |
| 55 | 52 | } |