@@ -65,7 +65,7 @@ |
||
65 | 65 | |
66 | 66 | private function setErrorHandler(): void |
67 | 67 | { |
68 | - set_error_handler(function (int $number, string $message, string $file, int $line) { |
|
68 | + set_error_handler(function(int $number, string $message, string $file, int $line) { |
|
69 | 69 | |
70 | 70 | if (!(error_reporting() & $number)) { |
71 | 71 | return; |
@@ -48,7 +48,7 @@ |
||
48 | 48 | $settings = new HttpConfiguration(); |
49 | 49 | } |
50 | 50 | |
51 | - $this->settings= $settings; |
|
51 | + $this->settings = $settings; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | */ |
160 | 160 | public function getAttribute($attribute, $default = null) |
161 | 161 | { |
162 | - if (! isset($this->attributes[$attribute])) { |
|
162 | + if (!isset($this->attributes[$attribute])) { |
|
163 | 163 | return $default; |
164 | 164 | } |
165 | 165 | |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | continue; |
220 | 220 | } |
221 | 221 | |
222 | - if (! $file instanceof UploadedFileInterface) { |
|
222 | + if (!$file instanceof UploadedFileInterface) { |
|
223 | 223 | throw new \InvalidArgumentException('Invalid leaf in uploaded files structure'); |
224 | 224 | } |
225 | 225 | } |
@@ -255,7 +255,7 @@ |
||
255 | 255 | */ |
256 | 256 | public static function fromJson($data, int $status = self::HTTP_OK, array $headers = []) |
257 | 257 | { |
258 | - if (! $data instanceof \JsonSerializable && ! is_array($data)) { |
|
258 | + if (!$data instanceof \JsonSerializable && !is_array($data)) { |
|
259 | 259 | throw new InvalidArgumentException('Invalid $data provided, method expects array or instance of \JsonSerializable.'); |
260 | 260 | } |
261 | 261 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | public function provideControllers(ControllerAggregate $controllers): void |
19 | 19 | { |
20 | - $controllers->add(function ($request) { |
|
20 | + $controllers->add(function($request) { |
|
21 | 21 | return Response::fromText("Hello {$request->getAttribute('name')}!"); |
22 | 22 | }, Route::get('/hello/{name}')); |
23 | 23 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -require_once __DIR__.'/../vendor/autoload.php'; |
|
2 | +require_once __DIR__ . '/../vendor/autoload.php'; |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * This example shows how to configure server as a daemon. |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | // Setup application and routes |
24 | 24 | $application = new Application(); |
25 | -$application->get('/hello/{name}', function (ServerRequestInterface $request) : ResponseInterface { |
|
25 | +$application->get('/hello/{name}', function(ServerRequestInterface $request) : ResponseInterface { |
|
26 | 26 | return Response::fromText("Hello {$request->getAttribute('name')}"); |
27 | 27 | }); |
28 | 28 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -require_once __DIR__.'/../vendor/autoload.php'; |
|
2 | +require_once __DIR__ . '/../vendor/autoload.php'; |
|
3 | 3 | |
4 | 4 | use Igni\Http\Application; |
5 | 5 | use Igni\Http\Response; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | // Setup application and routes |
14 | 14 | $application = new Application(); |
15 | -$application->get('/hello/{name}', function (ServerRequestInterface $request) : ResponseInterface { |
|
15 | +$application->get('/hello/{name}', function(ServerRequestInterface $request) : ResponseInterface { |
|
16 | 16 | return Response::fromText("Hello {$request->getAttribute('name')}"); |
17 | 17 | }); |
18 | 18 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -require_once __DIR__.'/../vendor/autoload.php'; |
|
2 | +require_once __DIR__ . '/../vendor/autoload.php'; |
|
3 | 3 | |
4 | 4 | use Igni\Http\Application; |
5 | 5 | use Igni\Http\Server; |