Passed
Push — develop ( 0559f7...d479cf )
by nguereza
10:40
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/ParameterCollection.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@  discard block
 block discarded – undo
54 54
  * @class ParameterCollection
55 55
  * @package Platine\Route
56 56
  */
57
-class ParameterCollection
58
-{
57
+class ParameterCollection {
59 58
     /**
60 59
      * The array of parameters
61 60
      * @var array<string, ParameterInterface>
@@ -73,8 +72,7 @@  discard block
 block discarded – undo
73 72
      *
74 73
      * @param ParameterInterface[] $parameters  the route parameters
75 74
      */
76
-    public function __construct(array $parameters = [])
77
-    {
75
+    public function __construct(array $parameters = []) {
78 76
         foreach ($parameters as $parameter) {
79 77
             if (!$parameter instanceof ParameterInterface) {
80 78
                 throw new InvalidArgumentException(sprintf(
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/RouteCollection.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,8 +56,7 @@  discard block
 block discarded – undo
56 56
  * @class RouteCollection
57 57
  * @package Platine\Route
58 58
  */
59
-class RouteCollection implements RouteCollectionInterface
60
-{
59
+class RouteCollection implements RouteCollectionInterface {
61 60
     /**
62 61
      * The list of routes
63 62
      * @var Route[]
@@ -74,8 +73,7 @@  discard block
 block discarded – undo
74 73
      * Create new instance
75 74
      * @param Route[] $routes
76 75
      */
77
-    public function __construct(array $routes = [])
78
-    {
76
+    public function __construct(array $routes = []) {
79 77
         foreach ($routes as $route) {
80 78
             if (!$route instanceof Route) {
81 79
                 throw new InvalidArgumentException(sprintf(
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.