Passed
Push — develop ( d479cf...02d72b )
by nguereza
10:32
created
src/Parameter.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,16 +52,14 @@
 block discarded – undo
52 52
  * @class Parameter
53 53
  * @package Platine\Route
54 54
  */
55
-class Parameter implements ParameterInterface
56
-{
55
+class Parameter implements ParameterInterface {
57 56
     /**
58 57
      * Create new parameter
59 58
      *
60 59
      * @param string $name  the name of the parameter
61 60
      * @param mixed $value the parameter value
62 61
      */
63
-    public function __construct(protected string $name, protected mixed $value)
64
-    {
62
+    public function __construct(protected string $name, protected mixed $value) {
65 63
     }
66 64
 
67 65
     /**
Please login to merge, or discard this patch.
src/ParameterInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@
 block discarded – undo
52 52
  * @class ParameterInterface
53 53
  * @package Platine\Route
54 54
  */
55
-interface ParameterInterface
56
-{
55
+interface ParameterInterface {
57 56
     /**
58 57
      * Return the name of the parameter
59 58
      *
Please login to merge, or discard this patch.
src/Exception/RouteNotFoundException.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,6 +40,5 @@
 block discarded – undo
40 40
  * @class RouteNotFoundException
41 41
  * @package Platine\Route\Exception
42 42
  */
43
-class RouteNotFoundException extends Exception
44
-{
43
+class RouteNotFoundException extends Exception {
45 44
 }
Please login to merge, or discard this patch.
src/Exception/InvalidRouteParameterException.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,6 +40,5 @@
 block discarded – undo
40 40
  * @class InvalidRouteParameterException
41 41
  * @package Platine\Route\Exception
42 42
  */
43
-class InvalidRouteParameterException extends Exception
44
-{
43
+class InvalidRouteParameterException extends Exception {
45 44
 }
Please login to merge, or discard this patch.
src/Exception/RouteAlreadyExistsException.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,6 +40,5 @@
 block discarded – undo
40 40
  * @class RouteAlreadyExistsException
41 41
  * @package Platine\Route\Exception
42 42
  */
43
-class RouteAlreadyExistsException extends Exception
44
-{
43
+class RouteAlreadyExistsException extends Exception {
45 44
 }
Please login to merge, or discard this patch.
src/RouteCollectionInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@
 block discarded – undo
55 55
  * @class RouteCollectionInterface
56 56
  * @package Platine\Route
57 57
  */
58
-interface RouteCollectionInterface
59
-{
58
+interface RouteCollectionInterface {
60 59
     /**
61 60
      * Add new route
62 61
      *
Please login to merge, or discard this patch.
src/Router.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     public function add(
141 141
         string $pattern,
142 142
         mixed $handler,
143
-        array|string $methods,
143
+        array | string $methods,
144 144
         string $name = '',
145 145
         array $attributes = []
146 146
     ): Route {
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
             $name = trim($pattern, '/');
431 431
         }
432 432
 
433
-        $this->group($pattern, function (Router $router) use ($handler, $maps, $name, $attributes) {
433
+        $this->group($pattern, function(Router $router) use ($handler, $maps, $name, $attributes) {
434 434
             foreach ($maps as $map) {
435 435
                 if ($map['many']) {
436 436
                     /** @var Route $route */
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,8 +57,7 @@  discard block
 block discarded – undo
57 57
  * @class Router
58 58
  * @package Platine\Route
59 59
  */
60
-class Router
61
-{
60
+class Router {
62 61
     /**
63 62
      * The current route group prefix
64 63
      * @var string
@@ -81,8 +80,7 @@  discard block
 block discarded – undo
81 80
      * Create new Router instance
82 81
      * @param RouteCollectionInterface|null $routes
83 82
      */
84
-    public function __construct(?RouteCollectionInterface $routes = null)
85
-    {
83
+    public function __construct(?RouteCollectionInterface $routes = null) {
86 84
         $this->routes = $routes ?? new RouteCollection();
87 85
     }
88 86
 
Please login to merge, or discard this patch.
src/RouteCollection.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@  discard block
 block discarded – undo
55 55
  * @class RouteCollection
56 56
  * @package Platine\Route
57 57
  */
58
-class RouteCollection implements RouteCollectionInterface
59
-{
58
+class RouteCollection implements RouteCollectionInterface {
60 59
     /**
61 60
      * The list of routes
62 61
      * @var Route[]
@@ -73,8 +72,7 @@  discard block
 block discarded – undo
73 72
      * Create new instance
74 73
      * @param Route[] $routes
75 74
      */
76
-    public function __construct(array $routes = [])
77
-    {
75
+    public function __construct(array $routes = []) {
78 76
         foreach ($routes as $route) {
79 77
             $this->add($route);
80 78
         }
Please login to merge, or discard this patch.
src/ParameterCollection.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@  discard block
 block discarded – undo
52 52
  * @class ParameterCollection
53 53
  * @package Platine\Route
54 54
  */
55
-class ParameterCollection
56
-{
55
+class ParameterCollection {
57 56
     /**
58 57
      * The array of parameters
59 58
      * @var array<string, ParameterInterface>
@@ -71,8 +70,7 @@  discard block
 block discarded – undo
71 70
      *
72 71
      * @param ParameterInterface[] $parameters  the route parameters
73 72
      */
74
-    public function __construct(array $parameters = [])
75
-    {
73
+    public function __construct(array $parameters = []) {
76 74
         foreach ($parameters as $parameter) {
77 75
             $this->add($parameter);
78 76
         }
Please login to merge, or discard this patch.