@@ -17,6 +17,6 @@ |
||
| 17 | 17 | { |
| 18 | 18 | // Do nothing |
| 19 | 19 | |
| 20 | - return (string) Uuid::uuid4(); |
|
| 20 | + return (string)Uuid::uuid4(); |
|
| 21 | 21 | } |
| 22 | 22 | } |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | 'handler' => new Autowire( |
| 63 | 63 | FileHandler::class, |
| 64 | 64 | [ |
| 65 | - 'directory' => $directories->get('runtime') . 'session', |
|
| 65 | + 'directory' => $directories->get('runtime').'session', |
|
| 66 | 66 | 'lifetime' => 86400, |
| 67 | 67 | ] |
| 68 | 68 | ), |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | $finalizer->shouldReceive('addFinalizer')->once(); |
| 41 | 41 | |
| 42 | 42 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 43 | - new class() implements LoaderInterface { |
|
| 43 | + new class() implements LoaderInterface{ |
|
| 44 | 44 | public function has(string $section): bool |
| 45 | 45 | { |
| 46 | 46 | return false; |
@@ -40,7 +40,8 @@ |
||
| 40 | 40 | $finalizer->shouldReceive('addFinalizer')->once(); |
| 41 | 41 | |
| 42 | 42 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 43 | - new class() implements LoaderInterface { |
|
| 43 | + new class() implements LoaderInterface |
|
| 44 | + { |
|
| 44 | 45 | public function has(string $section): bool |
| 45 | 46 | { |
| 46 | 47 | return false; |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | $finalizer->shouldReceive('addFinalizer')->once(); |
| 33 | 33 | |
| 34 | 34 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 35 | - new class() implements LoaderInterface { |
|
| 35 | + new class() implements LoaderInterface{ |
|
| 36 | 36 | public function has(string $section): bool |
| 37 | 37 | { |
| 38 | 38 | return false; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | ] |
| 84 | 84 | ])); |
| 85 | 85 | |
| 86 | - $logger = $this->container->get(LogsInterface::class)->getLogger('test');; |
|
| 86 | + $logger = $this->container->get(LogsInterface::class)->getLogger('test'); ; |
|
| 87 | 87 | |
| 88 | 88 | $this->assertCount(1, $logger->getProcessors()); |
| 89 | 89 | $this->assertInstanceOf(PsrLogMessageProcessor::class, $logger->getProcessors()[0]); |
@@ -40,7 +40,8 @@ |
||
| 40 | 40 | $finalizer->shouldReceive('addFinalizer')->once(); |
| 41 | 41 | |
| 42 | 42 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 43 | - new class() implements LoaderInterface { |
|
| 43 | + new class() implements LoaderInterface |
|
| 44 | + { |
|
| 44 | 45 | public function has(string $section): bool |
| 45 | 46 | { |
| 46 | 47 | return false; |
@@ -38,8 +38,10 @@ |
||
| 38 | 38 | public function locateCommands(): array |
| 39 | 39 | { |
| 40 | 40 | $commands = []; |
| 41 | - foreach ($this->classes->getScopedClasses('consoleCommands', SymfonyCommand::class) as $class) { |
|
| 42 | - if ($class->isAbstract()) { |
|
| 41 | + foreach ($this->classes->getScopedClasses('consoleCommands', SymfonyCommand::class) as $class) |
|
| 42 | + { |
|
| 43 | + if ($class->isAbstract()) |
|
| 44 | + { |
|
| 43 | 45 | continue; |
| 44 | 46 | } |
| 45 | 47 | |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | private readonly ScopedClassesInterface $classes, |
| 18 | 18 | ContainerInterface $container, |
| 19 | 19 | array $interceptors = [], |
| 20 | - ) { |
|
| 20 | + ){ |
|
| 21 | 21 | $this->container = $container; |
| 22 | 22 | $this->interceptors = $interceptors; |
| 23 | 23 | } |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | public function locateCommands(): array |
| 26 | 26 | { |
| 27 | 27 | $commands = []; |
| 28 | - foreach ($this->classes->getScopedClasses('consoleCommands', SymfonyCommand::class) as $class) { |
|
| 29 | - if ($class->isAbstract()) { |
|
| 28 | + foreach ($this->classes->getScopedClasses('consoleCommands', SymfonyCommand::class) as $class){ |
|
| 29 | + if ($class->isAbstract()){ |
|
| 30 | 30 | continue; |
| 31 | 31 | } |
| 32 | 32 | |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | 'directories' => [], |
| 48 | 48 | 'scopes' => [ |
| 49 | 49 | 'prototypes' => [ |
| 50 | - 'directories' => [__DIR__ . '/Fixtures'] |
|
| 50 | + 'directories' => [__DIR__.'/Fixtures'] |
|
| 51 | 51 | ] |
| 52 | 52 | ] |
| 53 | 53 | ]))); |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | 'test' => $this->defaultCache, |
| 77 | 77 | 'array' => new ArrayStorage(), |
| 78 | 78 | ][$name] ?? null; |
| 79 | - if ($result === null) { |
|
| 79 | + if ($result === null){ |
|
| 80 | 80 | throw new NotFoundException(); |
| 81 | 81 | } |
| 82 | 82 | return $result; |
@@ -76,7 +76,8 @@ |
||
| 76 | 76 | 'test' => $this->defaultCache, |
| 77 | 77 | 'array' => new ArrayStorage(), |
| 78 | 78 | ][$name] ?? null; |
| 79 | - if ($result === null) { |
|
| 79 | + if ($result === null) |
|
| 80 | + { |
|
| 80 | 81 | throw new NotFoundException(); |
| 81 | 82 | } |
| 82 | 83 | return $result; |
@@ -48,7 +48,8 @@ |
||
| 48 | 48 | |
| 49 | 49 | public function testRewindAfterRead(): void |
| 50 | 50 | { |
| 51 | - if (PHP_VERSION_ID < 80000) { |
|
| 51 | + if (PHP_VERSION_ID < 80000) |
|
| 52 | + { |
|
| 52 | 53 | $this->markTestSkipped('See issue https://bugs.php.net/bug.php?id=79927.'); |
| 53 | 54 | } |
| 54 | 55 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | public function testRewindAfterRead(): void |
| 50 | 50 | { |
| 51 | - if (PHP_VERSION_ID < 80000) { |
|
| 51 | + if (PHP_VERSION_ID < 80000){ |
|
| 52 | 52 | $this->markTestSkipped('See issue https://bugs.php.net/bug.php?id=79927.'); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -103,9 +103,9 @@ discard block |
||
| 103 | 103 | $rValue = 'return-value'; |
| 104 | 104 | $stream = $this->createStream(self::DEFAULT_SEQUENCE, $rValue); |
| 105 | 105 | |
| 106 | - $result = (string) $stream; |
|
| 106 | + $result = (string)$stream; |
|
| 107 | 107 | |
| 108 | - $this->assertSame(self::DEFAULT_CONTENT_RESULT . $rValue, $result); |
|
| 108 | + $this->assertSame(self::DEFAULT_CONTENT_RESULT.$rValue, $result); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | public function testToStringWithReturnOnly(): void |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $rValue = 'return-value'; |
| 114 | 114 | $stream = $this->createStream([], $rValue); |
| 115 | 115 | |
| 116 | - $result = (string) $stream; |
|
| 116 | + $result = (string)$stream; |
|
| 117 | 117 | |
| 118 | 118 | $this->assertSame($rValue, $result); |
| 119 | 119 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $stream = $this->createStream(); |
| 124 | 124 | $stream->close(); |
| 125 | 125 | |
| 126 | - $this->assertSame('', (string) $stream); |
|
| 126 | + $this->assertSame('', (string)$stream); |
|
| 127 | 127 | |
| 128 | 128 | $this->expectException(RuntimeException::class); |
| 129 | 129 | $this->expectExceptionMessage('Unable to read stream contents.'); |
@@ -27,23 +27,23 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | public function __toString(): string |
| 29 | 29 | { |
| 30 | - try { |
|
| 30 | + try{ |
|
| 31 | 31 | return $this->getContents(); |
| 32 | - } catch (\Exception $e) { |
|
| 32 | + }catch (\Exception $e){ |
|
| 33 | 33 | return ''; |
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | public function close(): void |
| 38 | 38 | { |
| 39 | - if ($this->stream !== null) { |
|
| 39 | + if ($this->stream !== null){ |
|
| 40 | 40 | $this->detach(); |
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | public function detach() |
| 45 | 45 | { |
| 46 | - if ($this->stream === null) { |
|
| 46 | + if ($this->stream === null){ |
|
| 47 | 47 | return null; |
| 48 | 48 | } |
| 49 | 49 | $this->stream = null; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | public function rewind(): void |
| 83 | 83 | { |
| 84 | - if ($this->stream !== null) { |
|
| 84 | + if ($this->stream !== null){ |
|
| 85 | 85 | $this->stream->rewind(); |
| 86 | 86 | } |
| 87 | 87 | $this->caret = 0; |
@@ -105,26 +105,26 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | public function read($length): string |
| 107 | 107 | { |
| 108 | - if (!$this->readable) { |
|
| 108 | + if (!$this->readable){ |
|
| 109 | 109 | throw new RuntimeException('Cannot read from non-readable stream.'); |
| 110 | 110 | } |
| 111 | - if ($this->stream === null) { |
|
| 111 | + if ($this->stream === null){ |
|
| 112 | 112 | throw new RuntimeException('Cannot read from detached stream.'); |
| 113 | 113 | } |
| 114 | - do { |
|
| 115 | - if ($this->started) { |
|
| 114 | + do{ |
|
| 115 | + if ($this->started){ |
|
| 116 | 116 | $read = (string)$this->stream->send(null); |
| 117 | - } else { |
|
| 117 | + }else{ |
|
| 118 | 118 | $this->started = true; |
| 119 | 119 | $read = (string)$this->stream->current(); |
| 120 | 120 | } |
| 121 | - if (!$this->stream->valid()) { |
|
| 121 | + if (!$this->stream->valid()){ |
|
| 122 | 122 | $read .= $this->stream->getReturn(); |
| 123 | 123 | break; |
| 124 | 124 | } |
| 125 | - } while ($read === ''); |
|
| 125 | + }while ($read === ''); |
|
| 126 | 126 | $this->caret += \strlen($read); |
| 127 | - if (!$this->stream->valid()) { |
|
| 127 | + if (!$this->stream->valid()){ |
|
| 128 | 128 | $this->size = $this->caret; |
| 129 | 129 | } |
| 130 | 130 | return $read; |
@@ -132,19 +132,19 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | public function getContents(): string |
| 134 | 134 | { |
| 135 | - if ($this->stream === null) { |
|
| 135 | + if ($this->stream === null){ |
|
| 136 | 136 | throw new RuntimeException('Unable to read stream contents.'); |
| 137 | 137 | } |
| 138 | 138 | $content = ''; |
| 139 | - do { |
|
| 139 | + do{ |
|
| 140 | 140 | $content .= $this->read(PHP_INT_MAX); |
| 141 | - } while ($this->stream->valid()); |
|
| 141 | + }while ($this->stream->valid()); |
|
| 142 | 142 | return $content; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | public function getMetadata($key = null) |
| 146 | 146 | { |
| 147 | - if ($this->stream === null) { |
|
| 147 | + if ($this->stream === null){ |
|
| 148 | 148 | return $key ? null : []; |
| 149 | 149 | } |
| 150 | 150 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | 'eof' => $this->eof(), |
| 154 | 154 | ]; |
| 155 | 155 | |
| 156 | - if (null === $key) { |
|
| 156 | + if (null === $key){ |
|
| 157 | 157 | return $meta; |
| 158 | 158 | } |
| 159 | 159 | |
@@ -27,23 +27,28 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | public function __toString(): string |
| 29 | 29 | { |
| 30 | - try { |
|
| 30 | + try |
|
| 31 | + { |
|
| 31 | 32 | return $this->getContents(); |
| 32 | - } catch (\Exception $e) { |
|
| 33 | + } |
|
| 34 | + catch (\Exception $e) |
|
| 35 | + { |
|
| 33 | 36 | return ''; |
| 34 | 37 | } |
| 35 | 38 | } |
| 36 | 39 | |
| 37 | 40 | public function close(): void |
| 38 | 41 | { |
| 39 | - if ($this->stream !== null) { |
|
| 42 | + if ($this->stream !== null) |
|
| 43 | + { |
|
| 40 | 44 | $this->detach(); |
| 41 | 45 | } |
| 42 | 46 | } |
| 43 | 47 | |
| 44 | 48 | public function detach() |
| 45 | 49 | { |
| 46 | - if ($this->stream === null) { |
|
| 50 | + if ($this->stream === null) |
|
| 51 | + { |
|
| 47 | 52 | return null; |
| 48 | 53 | } |
| 49 | 54 | $this->stream = null; |
@@ -81,7 +86,8 @@ discard block |
||
| 81 | 86 | |
| 82 | 87 | public function rewind(): void |
| 83 | 88 | { |
| 84 | - if ($this->stream !== null) { |
|
| 89 | + if ($this->stream !== null) |
|
| 90 | + { |
|
| 85 | 91 | $this->stream->rewind(); |
| 86 | 92 | } |
| 87 | 93 | $this->caret = 0; |
@@ -105,26 +111,34 @@ discard block |
||
| 105 | 111 | |
| 106 | 112 | public function read($length): string |
| 107 | 113 | { |
| 108 | - if (!$this->readable) { |
|
| 114 | + if (!$this->readable) |
|
| 115 | + { |
|
| 109 | 116 | throw new RuntimeException('Cannot read from non-readable stream.'); |
| 110 | 117 | } |
| 111 | - if ($this->stream === null) { |
|
| 118 | + if ($this->stream === null) |
|
| 119 | + { |
|
| 112 | 120 | throw new RuntimeException('Cannot read from detached stream.'); |
| 113 | 121 | } |
| 114 | - do { |
|
| 115 | - if ($this->started) { |
|
| 122 | + do |
|
| 123 | + { |
|
| 124 | + if ($this->started) |
|
| 125 | + { |
|
| 116 | 126 | $read = (string)$this->stream->send(null); |
| 117 | - } else { |
|
| 127 | + } |
|
| 128 | + else |
|
| 129 | + { |
|
| 118 | 130 | $this->started = true; |
| 119 | 131 | $read = (string)$this->stream->current(); |
| 120 | 132 | } |
| 121 | - if (!$this->stream->valid()) { |
|
| 133 | + if (!$this->stream->valid()) |
|
| 134 | + { |
|
| 122 | 135 | $read .= $this->stream->getReturn(); |
| 123 | 136 | break; |
| 124 | 137 | } |
| 125 | 138 | } while ($read === ''); |
| 126 | 139 | $this->caret += \strlen($read); |
| 127 | - if (!$this->stream->valid()) { |
|
| 140 | + if (!$this->stream->valid()) |
|
| 141 | + { |
|
| 128 | 142 | $this->size = $this->caret; |
| 129 | 143 | } |
| 130 | 144 | return $read; |
@@ -132,11 +146,13 @@ discard block |
||
| 132 | 146 | |
| 133 | 147 | public function getContents(): string |
| 134 | 148 | { |
| 135 | - if ($this->stream === null) { |
|
| 149 | + if ($this->stream === null) |
|
| 150 | + { |
|
| 136 | 151 | throw new RuntimeException('Unable to read stream contents.'); |
| 137 | 152 | } |
| 138 | 153 | $content = ''; |
| 139 | - do { |
|
| 154 | + do |
|
| 155 | + { |
|
| 140 | 156 | $content .= $this->read(PHP_INT_MAX); |
| 141 | 157 | } while ($this->stream->valid()); |
| 142 | 158 | return $content; |
@@ -144,7 +160,8 @@ discard block |
||
| 144 | 160 | |
| 145 | 161 | public function getMetadata($key = null) |
| 146 | 162 | { |
| 147 | - if ($this->stream === null) { |
|
| 163 | + if ($this->stream === null) |
|
| 164 | + { |
|
| 148 | 165 | return $key ? null : []; |
| 149 | 166 | } |
| 150 | 167 | |
@@ -153,7 +170,8 @@ discard block |
||
| 153 | 170 | 'eof' => $this->eof(), |
| 154 | 171 | ]; |
| 155 | 172 | |
| 156 | - if (null === $key) { |
|
| 173 | + if (null === $key) |
|
| 174 | + { |
|
| 157 | 175 | return $meta; |
| 158 | 176 | } |
| 159 | 177 | |