@@ -34,24 +34,24 @@ discard block |
||
| 34 | 34 | yield [$from(fn(string $string = self::STRING_CONST) => 0), 'string $string = self::STRING_CONST']; |
| 35 | 35 | yield [ |
| 36 | 36 | $from(fn(string $string = ProxyClassRendererTest::STRING_CONST) => 0), |
| 37 | - 'string $string = \\' . self::class . '::STRING_CONST', |
|
| 37 | + 'string $string = \\'.self::class.'::STRING_CONST', |
|
| 38 | 38 | ]; |
| 39 | - yield [$from(fn(string|int $string = self::INT_CONST) => 0), 'string|int $string = self::INT_CONST']; |
|
| 39 | + yield [$from(fn(string | int $string = self::INT_CONST) => 0), 'string|int $string = self::INT_CONST']; |
|
| 40 | 40 | yield [$from(fn(mixed $string = 42) => 0), 'mixed $string = 42']; |
| 41 | 41 | yield [$from(fn(int $string = 42) => 0), 'int $string = 42']; |
| 42 | 42 | yield [$from(fn(float $string = 42) => 0), 'float $string = 42.0']; |
| 43 | 43 | yield [$from(fn(?bool $string = false) => 0), '?bool $string = false']; |
| 44 | - yield [$from(fn(bool|null $string = true) => 0), '?bool $string = true']; |
|
| 44 | + yield [$from(fn(bool | null $string = true) => 0), '?bool $string = true']; |
|
| 45 | 45 | yield [$from(fn(object $string = null) => 0), '?object $string = NULL']; |
| 46 | 46 | yield [$from(fn(iterable $string = null) => 0), '?iterable $string = NULL']; |
| 47 | 47 | yield [$from(fn(Countable&ArrayAccess $val) => 0), '\Countable&\ArrayAccess $val']; |
| 48 | 48 | yield [$from(fn(string ...$val) => 0), 'string ...$val']; |
| 49 | - yield [$from(fn(string|int ...$val) => 0), 'string|int ...$val']; |
|
| 50 | - yield [$from(fn(string|int &$link) => 0), 'string|int &$link']; |
|
| 49 | + yield [$from(fn(string | int ...$val) => 0), 'string|int ...$val']; |
|
| 50 | + yield [$from(fn(string | int &$link) => 0), 'string|int &$link']; |
|
| 51 | 51 | yield [$from(self::withSelf(...)), \sprintf('\%s $self = new self()', self::class)]; |
| 52 | 52 | yield [$from(fn(object $link = new \stdClass()) => 0), 'object $link = new \stdClass()']; |
| 53 | 53 | yield [ |
| 54 | - $from(fn(#[Proxy] float|int|\stdClass|null $string = new \stdClass(1, 2, bar: "\n'zero")) => 0), |
|
| 54 | + $from(fn(#[Proxy] float | int | \stdClass | null $string = new \stdClass(1, 2, bar: "\n'zero")) => 0), |
|
| 55 | 55 | "\stdClass|int|float|null \$string = new \stdClass(1, 2, bar: '\n\'zero')", |
| 56 | 56 | ]; |
| 57 | 57 | yield [ |
@@ -76,18 +76,18 @@ discard block |
||
| 76 | 76 | public const INT_CONST = 42; |
| 77 | 77 | |
| 78 | 78 | #[ExpectedAttribute('public function test1(...$variadic)')] |
| 79 | - public function test1(...$variadic) {} |
|
| 79 | + public function test1(...$variadic){} |
|
| 80 | 80 | #[ExpectedAttribute('public function test2(string|int $string = self::INT_CONST): string|int')] |
| 81 | - public function test2(string|int $string = self::INT_CONST): string|int {} |
|
| 81 | + public function test2(string | int $string = self::INT_CONST): string | int {} |
|
| 82 | 82 | #[ExpectedAttribute('public function test3(object $obj = new \stdClass(new \stdClass(), new \stdClass()))')] |
| 83 | - public function test3(object $obj = new stdClass(new stdClass(), new stdClass())) {} |
|
| 84 | - #[ExpectedAttribute('public function test4(): \\' . ProxyClassRendererTest::class)] |
|
| 83 | + public function test3(object $obj = new stdClass(new stdClass(), new stdClass())){} |
|
| 84 | + #[ExpectedAttribute('public function test4(): \\'.ProxyClassRendererTest::class)] |
|
| 85 | 85 | public function test4(): ProxyClassRendererTest {} |
| 86 | 86 | #[ExpectedAttribute('public function &test5(): string')] |
| 87 | 87 | public function &test5(): string {} |
| 88 | 88 | }; |
| 89 | 89 | |
| 90 | - foreach ((new \ReflectionClass($class))->getMethods() as $method) { |
|
| 90 | + foreach ((new \ReflectionClass($class))->getMethods() as $method){ |
|
| 91 | 91 | $expected = $method->getAttributes(ExpectedAttribute::class)[0]->newInstance(); |
| 92 | 92 | |
| 93 | 93 | yield [$method, $expected->value]; |
@@ -117,6 +117,6 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | public function __construct( |
| 119 | 119 | public readonly string $value, |
| 120 | - ) { |
|
| 120 | + ){ |
|
| 121 | 121 | } |
| 122 | 122 | } |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | return $name; |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | - public function qux(int|string $age = 42): string|int |
|
| 18 | + public function qux(int | string $age = 42): string | int |
|
| 19 | 19 | { |
| 20 | 20 | return $age; |
| 21 | 21 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | public function concat(string $prefix, string &$byLink): array |
| 39 | 39 | { |
| 40 | - $byLink = $prefix . $byLink; |
|
| 40 | + $byLink = $prefix.$byLink; |
|
| 41 | 41 | return \func_get_args(); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -48,8 +48,8 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | public function concatMultiple(string $prefix, string &...$byLink): array |
| 50 | 50 | { |
| 51 | - foreach ($byLink as $k => $link) { |
|
| 52 | - $byLink[$k] = $prefix . $link; |
|
| 51 | + foreach ($byLink as $k => $link){ |
|
| 52 | + $byLink[$k] = $prefix.$link; |
|
| 53 | 53 | unset($link); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | public function baz(string $name, int $age): string; |
| 14 | 14 | |
| 15 | - public function qux(string|int $age = 42): string|int; |
|
| 15 | + public function qux(string | int $age = 42): string | int; |
|
| 16 | 16 | |
| 17 | 17 | public function space(mixed $test age = 42): mixed; |
| 18 | 18 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | FiberHelper::runInFiber( |
| 32 | 32 | self::functionScopedTestDataIterator(), |
| 33 | - static function (mixed $suspendValue) { |
|
| 33 | + static function (mixed $suspendValue){ |
|
| 34 | 34 | self::assertNull(ContainerScope::getContainer()); |
| 35 | 35 | self::assertTrue(\in_array($suspendValue, self::TEST_DATA, true)); |
| 36 | 36 | }, |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | ); |
| 64 | 64 | |
| 65 | 65 | self::assertCount(5, $result); |
| 66 | - foreach ($result as $suspendValue) { |
|
| 66 | + foreach ($result as $suspendValue){ |
|
| 67 | 67 | self::assertSame(self::TEST_DATA, $suspendValue); |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | ); |
| 82 | 82 | |
| 83 | 83 | self::assertCount(2, $result); |
| 84 | - foreach ($result as $suspendValue) { |
|
| 84 | + foreach ($result as $suspendValue){ |
|
| 85 | 85 | self::assertSame(self::TEST_DATA, $suspendValue); |
| 86 | 86 | } |
| 87 | 87 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $this->expectExceptionMessage('test'); |
| 93 | 93 | |
| 94 | 94 | FiberHelper::runInFiber( |
| 95 | - static function () { |
|
| 95 | + static function (){ |
|
| 96 | 96 | return (new Container())->runScoped( |
| 97 | 97 | function (): string { |
| 98 | 98 | $result = ''; |
@@ -114,15 +114,15 @@ discard block |
||
| 114 | 114 | public function testCatchThrownException(): void |
| 115 | 115 | { |
| 116 | 116 | $result = FiberHelper::runInFiber( |
| 117 | - static function () { |
|
| 117 | + static function (){ |
|
| 118 | 118 | return (new Container())->runScoped( |
| 119 | 119 | function (): string { |
| 120 | 120 | $result = ''; |
| 121 | 121 | $result .= Fiber::suspend('foo'); |
| 122 | 122 | $result .= Fiber::suspend('bar'); |
| 123 | - try { |
|
| 123 | + try{ |
|
| 124 | 124 | $result .= Fiber::suspend('error'); |
| 125 | - } catch (\Throwable $e) { |
|
| 125 | + }catch (\Throwable $e){ |
|
| 126 | 126 | $result .= $e->getMessage(); |
| 127 | 127 | } |
| 128 | 128 | $result .= Fiber::suspend('baz'); |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | ?callable $load = null, |
| 153 | 153 | ?Container $container = null, |
| 154 | 154 | ): callable { |
| 155 | - return static function () use ($load, $container): array { |
|
| 155 | + return static function () use ($load, $container) : array { |
|
| 156 | 156 | // The function should be called in a fiber |
| 157 | 157 | self::assertNotNull(Fiber::getCurrent()); |
| 158 | 158 | |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | $resource = $c3->get('resource'); |
| 174 | 174 | self::assertInstanceOf(DateTimeImmutable::class, $c3->get('bar')); |
| 175 | 175 | self::assertInstanceOf(stdClass::class, $resource); |
| 176 | - foreach (self::TEST_DATA as $key => $value) { |
|
| 176 | + foreach (self::TEST_DATA as $key => $value){ |
|
| 177 | 177 | $resource->$key = $value; |
| 178 | 178 | $load === null or $load(); |
| 179 | 179 | Fiber::suspend($value); |
@@ -186,8 +186,8 @@ discard block |
||
| 186 | 186 | }, ['foo' => new DateTime()]); |
| 187 | 187 | self::assertFalse($c1->has('foo')); |
| 188 | 188 | |
| 189 | - self::assertSame(self::TEST_DATA, (array) $result); |
|
| 190 | - return (array) $result; |
|
| 189 | + self::assertSame(self::TEST_DATA, (array)$result); |
|
| 190 | + return (array)$result; |
|
| 191 | 191 | }; |
| 192 | 192 | } |
| 193 | 193 | } |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | { |
| 11 | 11 | public function __construct( |
| 12 | 12 | #[Proxy] public LoggerInterface $logger, |
| 13 | - ) { |
|
| 13 | + ){ |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | public function getLogger(): LoggerInterface |
@@ -22,11 +22,11 @@ discard block |
||
| 22 | 22 | { |
| 23 | 23 | $fiber = new Fiber($callable); |
| 24 | 24 | $value = $fiber->start(); |
| 25 | - while (!$fiber->isTerminated()) { |
|
| 26 | - if ($check !== null) { |
|
| 27 | - try { |
|
| 25 | + while (!$fiber->isTerminated()){ |
|
| 26 | + if ($check !== null){ |
|
| 27 | + try{ |
|
| 28 | 28 | $value = $check($value); |
| 29 | - } catch (\Throwable $e) { |
|
| 29 | + }catch (\Throwable $e){ |
|
| 30 | 30 | $value = $fiber->throw($e); |
| 31 | 31 | continue; |
| 32 | 32 | } |
@@ -50,14 +50,14 @@ discard block |
||
| 50 | 50 | /** Values that were suspended by the fiber. */ |
| 51 | 51 | $suspends = []; |
| 52 | 52 | $results = []; |
| 53 | - foreach ($callables as $key => $callable) { |
|
| 53 | + foreach ($callables as $key => $callable){ |
|
| 54 | 54 | $fiberGenerators[$key] = (static function () use ($callable) { |
| 55 | 55 | $fiber = new Fiber($callable); |
| 56 | 56 | // Get ready |
| 57 | 57 | yield null; |
| 58 | 58 | |
| 59 | 59 | $value = yield $fiber->start(); |
| 60 | - while (!$fiber->isTerminated()) { |
|
| 60 | + while (!$fiber->isTerminated()){ |
|
| 61 | 61 | $value = yield $fiber->resume($value); |
| 62 | 62 | } |
| 63 | 63 | return $fiber->getReturn(); |
@@ -67,15 +67,15 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | |
| 70 | - while ($fiberGenerators !== []) { |
|
| 71 | - foreach ($fiberGenerators as $key => $generator) { |
|
| 72 | - try { |
|
| 70 | + while ($fiberGenerators !== []){ |
|
| 71 | + foreach ($fiberGenerators as $key => $generator){ |
|
| 72 | + try{ |
|
| 73 | 73 | $suspends[$key] = $generator->send($suspends[$key]); |
| 74 | - if (!$generator->valid()) { |
|
| 74 | + if (!$generator->valid()){ |
|
| 75 | 75 | $results[$key] = $generator->getReturn(); |
| 76 | 76 | unset($fiberGenerators[$key]); |
| 77 | 77 | } |
| 78 | - } catch (\Throwable $e) { |
|
| 78 | + }catch (\Throwable $e){ |
|
| 79 | 79 | unset($fiberGenerators[$key]); |
| 80 | 80 | $results[$key] = $e; |
| 81 | 81 | } |
@@ -23,6 +23,6 @@ |
||
| 23 | 23 | public readonly ?string $name = null, |
| 24 | 24 | public readonly array $bindings = [], |
| 25 | 25 | public readonly bool $autowire = true, |
| 26 | - ) { |
|
| 26 | + ){ |
|
| 27 | 27 | } |
| 28 | 28 | } |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | { |
| 11 | 11 | public function __construct( |
| 12 | 12 | #[Proxy] public ContextInterface $context, |
| 13 | - ) { |
|
| 13 | + ){ |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | public function getContext(): ContextInterface |
@@ -7,11 +7,11 @@ |
||
| 7 | 7 | final class Context implements ContextInterface |
| 8 | 8 | { |
| 9 | 9 | public function __construct( |
| 10 | - public \Stringable|string|null $value, |
|
| 11 | - ) { |
|
| 10 | + public \Stringable | string | null $value, |
|
| 11 | + ){ |
|
| 12 | 12 | } |
| 13 | 13 | |
| 14 | - public function getValue(): \Stringable|string|null |
|
| 14 | + public function getValue(): \Stringable | string | null |
|
| 15 | 15 | { |
| 16 | 16 | return $this->value; |
| 17 | 17 | } |