@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | namespace Mezon\Router; |
| 4 | 4 | |
| 5 | 5 | /** |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function callRoute($route) |
| 70 | 70 | { |
| 71 | - if (! $this->regExpsWereCompiled) { |
|
| 71 | + if (!$this->regExpsWereCompiled) { |
|
| 72 | 72 | $this->compileRegexpForBunches(); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | namespace Mezon\Router; |
| 4 | 4 | |
| 5 | 5 | /** |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | $return = ''; |
| 35 | 35 | |
| 36 | - for ($n = 0; $n <= $i; $n ++) { |
|
| 36 | + for ($n = 0; $n <= $i; $n++) { |
|
| 37 | 37 | $return .= '()'; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | private function compileRegexpForBunch(array &$bunch): void |
| 49 | 49 | { |
| 50 | - if (! empty($bunch['bunch'])) { |
|
| 50 | + if (!empty($bunch['bunch'])) { |
|
| 51 | 51 | $bunch['regexp'] = ''; |
| 52 | 52 | /** @var array<int, array{pattern: string}> $hashTable */ |
| 53 | 53 | $hashTable = []; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | private function compileRegexpForBunches(): void |
| 88 | 88 | { |
| 89 | - if (! $this->regExpsWereCompiled) { |
|
| 89 | + if (!$this->regExpsWereCompiled) { |
|
| 90 | 90 | foreach (SuppportedRequestMethods::getListOfSupportedRequestMethods() as $requestMethod) { |
| 91 | 91 | foreach ($this->paramRoutes[$requestMethod] as &$bunch) { |
| 92 | 92 | $this->compileRegexpForBunch($bunch); |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $this->paramRoutes[$requestMethod][] = [ |
| 127 | 127 | 'bunch' => [] |
| 128 | 128 | ]; |
| 129 | - $bunchCursor ++; |
|
| 129 | + $bunchCursor++; |
|
| 130 | 130 | $lastBunchSize = 0; |
| 131 | 131 | } |
| 132 | 132 | |
@@ -220,12 +220,12 @@ discard block |
||
| 220 | 220 | ]; |
| 221 | 221 | // TODO try to remove $hasRoutes flag |
| 222 | 222 | $hasRoutes = false; |
| 223 | - if (! empty($this->staticRoutes[$requestMethod])) { |
|
| 223 | + if (!empty($this->staticRoutes[$requestMethod])) { |
|
| 224 | 224 | $trace[] = implode(', ', array_keys($this->staticRoutes[$requestMethod])); |
| 225 | 225 | $trace[] = ', '; |
| 226 | 226 | $hasRoutes = true; |
| 227 | 227 | } |
| 228 | - if (! empty($this->paramRoutes[$requestMethod])) { |
|
| 228 | + if (!empty($this->paramRoutes[$requestMethod])) { |
|
| 229 | 229 | foreach ($this->paramRoutes[$requestMethod] as $bunch) { |
| 230 | 230 | $items = []; |
| 231 | 231 | foreach ($bunch['bunch'] as $item) { |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | } |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | - if (! $hasRoutes) { |
|
| 239 | + if (!$hasRoutes) { |
|
| 240 | 240 | $trace[] = '<none>'; |
| 241 | 241 | } |
| 242 | 242 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | namespace Mezon\Router\Tests; |
| 4 | 4 | |
| 5 | 5 | /** |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | namespace Mezon\Router\Tests\Standart; |
| 4 | 4 | |
| 5 | 5 | use Mezon\Router\RouterInterface; |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | namespace Mezon\Router\Tests\Standart; |
| 4 | 4 | |
| 5 | 5 | use Mezon\Router\Tests\Base\DynamicRoutesTestClass; |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | namespace Mezon\Router\Tests\Standart; |
| 4 | 4 | |
| 5 | 5 | use Mezon\Router\Router; |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | namespace Mezon\Router\Tests\Standart; |
| 4 | 4 | |
| 5 | 5 | use Mezon\Router\Router; |
@@ -30,10 +30,10 @@ discard block |
||
| 30 | 30 | public function testValidRouteParameter(): void |
| 31 | 31 | { |
| 32 | 32 | $router = new Router(); |
| 33 | - $router->addRoute('/catalog/all/', function (string $route): string { |
|
| 33 | + $router->addRoute('/catalog/all/', function(string $route): string { |
|
| 34 | 34 | return $route; |
| 35 | 35 | }); |
| 36 | - $router->addRoute('/catalog/[i:cat_id]', function (string $route): string { |
|
| 36 | + $router->addRoute('/catalog/[i:cat_id]', function(string $route): string { |
|
| 37 | 37 | return $route; |
| 38 | 38 | }); |
| 39 | 39 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | namespace Mezon\Router\Tests\Standart; |
| 4 | 4 | |
| 5 | 5 | use PHPUnit\Framework\TestCase; |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | namespace Mezon\Router\Tests\Standart; |
| 4 | 4 | |
| 5 | 5 | use Mezon\Router\Tests\Base\StaticRoutesTestClass; |