@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | class StreamsTest extends TestCase |
14 | 14 | { |
15 | - private const FIXTURE_DIRECTORY = __DIR__ . '/fixtures'; |
|
15 | + private const FIXTURE_DIRECTORY = __DIR__.'/fixtures'; |
|
16 | 16 | |
17 | 17 | public function testGetUri(): void |
18 | 18 | { |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | self::assertSame(\strlen('sample text'), \filesize($filename)); |
26 | 26 | self::assertSame(\md5('sample text'), \md5_file($filename)); |
27 | 27 | |
28 | - $newFilename = self::FIXTURE_DIRECTORY . '/test.txt'; |
|
28 | + $newFilename = self::FIXTURE_DIRECTORY.'/test.txt'; |
|
29 | 29 | \copy($filename, $newFilename); |
30 | 30 | |
31 | 31 | self::assertFileExists($newFilename); |
@@ -64,15 +64,15 @@ discard block |
||
64 | 64 | #[\PHPUnit\Framework\Attributes\RequiresPhp('< 8.0')] |
65 | 65 | public function testException(): void |
66 | 66 | { |
67 | - try { |
|
67 | + try{ |
|
68 | 68 | \fopen('spiral://non-exists', 'rb'); |
69 | - } catch (\Throwable $e) { |
|
69 | + }catch (\Throwable $e){ |
|
70 | 70 | self::assertStringContainsString('failed to open stream', $e->getMessage()); |
71 | 71 | } |
72 | 72 | |
73 | - try { |
|
73 | + try{ |
|
74 | 74 | \filemtime('spiral://non-exists'); |
75 | - } catch (\Throwable $e) { |
|
75 | + }catch (\Throwable $e){ |
|
76 | 76 | self::assertStringContainsString('stat failed', $e->getMessage()); |
77 | 77 | } |
78 | 78 | } |
@@ -80,15 +80,15 @@ discard block |
||
80 | 80 | #[\PHPUnit\Framework\Attributes\RequiresPhp('>= 8.0')] |
81 | 81 | public function testExceptionPHP8(): void |
82 | 82 | { |
83 | - try { |
|
83 | + try{ |
|
84 | 84 | \fopen('spiral://non-exists', 'rb'); |
85 | - } catch (\Throwable $e) { |
|
85 | + }catch (\Throwable $e){ |
|
86 | 86 | self::assertStringContainsString('Failed to open stream', $e->getMessage()); |
87 | 87 | } |
88 | 88 | |
89 | - try { |
|
89 | + try{ |
|
90 | 90 | \filemtime('spiral://non-exists'); |
91 | - } catch (\Throwable $e) { |
|
91 | + }catch (\Throwable $e){ |
|
92 | 92 | self::assertStringContainsString('stat failed', $e->getMessage()); |
93 | 93 | } |
94 | 94 | } |
@@ -64,15 +64,21 @@ discard block |
||
64 | 64 | #[\PHPUnit\Framework\Attributes\RequiresPhp('< 8.0')] |
65 | 65 | public function testException(): void |
66 | 66 | { |
67 | - try { |
|
67 | + try |
|
68 | + { |
|
68 | 69 | \fopen('spiral://non-exists', 'rb'); |
69 | - } catch (\Throwable $e) { |
|
70 | + } |
|
71 | + catch (\Throwable $e) |
|
72 | + { |
|
70 | 73 | self::assertStringContainsString('failed to open stream', $e->getMessage()); |
71 | 74 | } |
72 | 75 | |
73 | - try { |
|
76 | + try |
|
77 | + { |
|
74 | 78 | \filemtime('spiral://non-exists'); |
75 | - } catch (\Throwable $e) { |
|
79 | + } |
|
80 | + catch (\Throwable $e) |
|
81 | + { |
|
76 | 82 | self::assertStringContainsString('stat failed', $e->getMessage()); |
77 | 83 | } |
78 | 84 | } |
@@ -80,15 +86,21 @@ discard block |
||
80 | 86 | #[\PHPUnit\Framework\Attributes\RequiresPhp('>= 8.0')] |
81 | 87 | public function testExceptionPHP8(): void |
82 | 88 | { |
83 | - try { |
|
89 | + try |
|
90 | + { |
|
84 | 91 | \fopen('spiral://non-exists', 'rb'); |
85 | - } catch (\Throwable $e) { |
|
92 | + } |
|
93 | + catch (\Throwable $e) |
|
94 | + { |
|
86 | 95 | self::assertStringContainsString('Failed to open stream', $e->getMessage()); |
87 | 96 | } |
88 | 97 | |
89 | - try { |
|
98 | + try |
|
99 | + { |
|
90 | 100 | \filemtime('spiral://non-exists'); |
91 | - } catch (\Throwable $e) { |
|
101 | + } |
|
102 | + catch (\Throwable $e) |
|
103 | + { |
|
92 | 104 | self::assertStringContainsString('stat failed', $e->getMessage()); |
93 | 105 | } |
94 | 106 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $dispatcher |
55 | 55 | ->expects(self::exactly(2)) |
56 | 56 | ->method('dispatch') |
57 | - ->with($this->callback(static fn(Routing|RouteMatched $event): bool => $event->request instanceof ServerRequest)); |
|
57 | + ->with($this->callback(static fn(Routing | RouteMatched $event): bool => $event->request instanceof ServerRequest)); |
|
58 | 58 | |
59 | 59 | $router = $this->makeRouter('', $dispatcher); |
60 | 60 | $router->setDefault($route); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $router->import($configurator); |
91 | 91 | $this->getContainer()->get(GroupRegistry::class)->registerRoutes($router); |
92 | 92 | |
93 | - $uri = (string) $router->uri('foo', ['host' => 'some']); |
|
93 | + $uri = (string)$router->uri('foo', ['host' => 'some']); |
|
94 | 94 | self::assertSame('some/register', $uri); |
95 | 95 | self::assertStringNotContainsString($uri, 'https://host.com'); |
96 | 96 | } |