@@ -10,14 +10,14 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | final class ServerBag extends InputBag |
| 12 | 12 | { |
| 13 | - public function has(int|string $name): bool |
|
| 13 | + public function has(int | string $name): bool |
|
| 14 | 14 | { |
| 15 | - return parent::has($this->normalize((string) $name)); |
|
| 15 | + return parent::has($this->normalize((string)$name)); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | - public function get(int|string $name, mixed $default = null): mixed |
|
| 18 | + public function get(int | string $name, mixed $default = null): mixed |
|
| 19 | 19 | { |
| 20 | - return parent::get($this->normalize((string) $name), $default); |
|
| 20 | + return parent::get($this->normalize((string)$name), $default); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | public function fetch(array $keys, bool $fill = false, mixed $filler = null): array |
@@ -20,9 +20,9 @@ |
||
| 20 | 20 | /** |
| 21 | 21 | * Locale local filename (virtual filename) associated with UploadedFile resource. |
| 22 | 22 | */ |
| 23 | - public function getFilename(int|string $name): ?string |
|
| 23 | + public function getFilename(int | string $name): ?string |
|
| 24 | 24 | { |
| 25 | - if (!empty($file = $this->get($name)) && !$file->getError()) { |
|
| 25 | + if (!empty($file = $this->get($name)) && !$file->getError()){ |
|
| 26 | 26 | return StreamWrapper::getFilename($file->getStream()); |
| 27 | 27 | } |
| 28 | 28 | |
@@ -22,7 +22,8 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | public function getFilename(int|string $name): ?string |
| 24 | 24 | { |
| 25 | - if (!empty($file = $this->get($name)) && !$file->getError()) { |
|
| 25 | + if (!empty($file = $this->get($name)) && !$file->getError()) |
|
| 26 | + { |
|
| 26 | 27 | return StreamWrapper::getFilename($file->getStream()); |
| 27 | 28 | } |
| 28 | 29 | |
@@ -22,7 +22,8 @@ discard block |
||
| 22 | 22 | { |
| 23 | 23 | $value = parent::get($this->normalize((string) $name), $default); |
| 24 | 24 | |
| 25 | - if (\is_string($implode) && !empty($implode) && \is_array($value)) { |
|
| 25 | + if (\is_string($implode) && !empty($implode) && \is_array($value)) |
|
| 26 | + { |
|
| 26 | 27 | return \implode($implode, $value); |
| 27 | 28 | } |
| 28 | 29 | |
@@ -38,8 +39,10 @@ discard block |
||
| 38 | 39 | |
| 39 | 40 | $values = parent::fetch($keys, $fill, $filler); |
| 40 | 41 | |
| 41 | - if (!empty($implode)) { |
|
| 42 | - foreach ($values as &$value) { |
|
| 42 | + if (!empty($implode)) |
|
| 43 | + { |
|
| 44 | + foreach ($values as &$value) |
|
| 45 | + { |
|
| 43 | 46 | $value = \implode($implode, $value); |
| 44 | 47 | unset($value); |
| 45 | 48 | } |
@@ -10,19 +10,19 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | final class HeadersBag extends InputBag |
| 12 | 12 | { |
| 13 | - public function has(int|string $name): bool |
|
| 13 | + public function has(int | string $name): bool |
|
| 14 | 14 | { |
| 15 | - return parent::has($this->normalize((string) $name)); |
|
| 15 | + return parent::has($this->normalize((string)$name)); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * @param false|string $implode Implode header lines, false to return header as array. |
| 20 | 20 | */ |
| 21 | - public function get(int|string $name, mixed $default = null, bool|string $implode = ','): array|string|null |
|
| 21 | + public function get(int | string $name, mixed $default = null, bool | string $implode = ','): array | string | null |
|
| 22 | 22 | { |
| 23 | - $value = parent::get($this->normalize((string) $name), $default); |
|
| 23 | + $value = parent::get($this->normalize((string)$name), $default); |
|
| 24 | 24 | |
| 25 | - if (\is_string($implode) && !empty($implode) && \is_array($value)) { |
|
| 25 | + if (\is_string($implode) && !empty($implode) && \is_array($value)){ |
|
| 26 | 26 | return \implode($implode, $value); |
| 27 | 27 | } |
| 28 | 28 | |
@@ -34,12 +34,12 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function fetch(array $keys, bool $fill = false, mixed $filler = null, ?string $implode = ','): array |
| 36 | 36 | { |
| 37 | - $keys = \array_map(fn(string $header): string => $this->normalize($header), $keys); |
|
| 37 | + $keys = \array_map(fn(string $header) : string => $this->normalize($header), $keys); |
|
| 38 | 38 | |
| 39 | 39 | $values = parent::fetch($keys, $fill, $filler); |
| 40 | 40 | |
| 41 | - if (!empty($implode)) { |
|
| 42 | - foreach ($values as &$value) { |
|
| 41 | + if (!empty($implode)){ |
|
| 42 | + foreach ($values as &$value){ |
|
| 43 | 43 | $value = \implode($implode, $value); |
| 44 | 44 | unset($value); |
| 45 | 45 | } |
@@ -25,6 +25,6 @@ |
||
| 25 | 25 | |
| 26 | 26 | public function init(ViewsBootloader $views): void |
| 27 | 27 | { |
| 28 | - $views->addDirectory('sendit', __DIR__ . '/../../views'); |
|
| 28 | + $views->addDirectory('sendit', __DIR__.'/../../views'); |
|
| 29 | 29 | } |
| 30 | 30 | } |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | { |
| 30 | 30 | $name ??= $this->default; |
| 31 | 31 | |
| 32 | - if (!isset($this->transports[$name])) { |
|
| 32 | + if (!isset($this->transports[$name])){ |
|
| 33 | 33 | throw new TransportException(\sprintf('Undefined auth transport %s', $name)); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -29,7 +29,8 @@ |
||
| 29 | 29 | { |
| 30 | 30 | $name ??= $this->default; |
| 31 | 31 | |
| 32 | - if (!isset($this->transports[$name])) { |
|
| 32 | + if (!isset($this->transports[$name])) |
|
| 33 | + { |
|
| 33 | 34 | throw new TransportException(\sprintf('Undefined auth transport %s', $name)); |
| 34 | 35 | } |
| 35 | 36 | |
@@ -69,7 +69,8 @@ discard block |
||
| 69 | 69 | ->andReturn(['first' => ['foo' => 'bar'], 'second' => ['foo' => 'baz']]); |
| 70 | 70 | |
| 71 | 71 | [$schema, $errors] = $this->mapper->map( |
| 72 | - $filter = new class implements FilterInterface { |
|
| 72 | + $filter = new class implements FilterInterface |
|
| 73 | + { |
|
| 73 | 74 | #[Post] |
| 74 | 75 | public string $username; |
| 75 | 76 | |
@@ -165,7 +166,8 @@ discard block |
||
| 165 | 166 | ->andReturn(['first' => ['foo' => 'bar'], 'second' => ['foo' => 'baz']]); |
| 166 | 167 | |
| 167 | 168 | [$schema, $errors] = $this->mapper->map( |
| 168 | - $filter = new class implements FilterInterface { |
|
| 169 | + $filter = new class implements FilterInterface |
|
| 170 | + { |
|
| 169 | 171 | #[Post] |
| 170 | 172 | public string $username; |
| 171 | 173 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | final class AttributeMapperTest extends BaseTestCase |
| 28 | 28 | { |
| 29 | - private m\LegacyMockInterface|m\MockInterface|FilterProviderInterface $provider; |
|
| 29 | + private m\LegacyMockInterface | m\MockInterface | FilterProviderInterface $provider; |
|
| 30 | 30 | private AttributeMapper $mapper; |
| 31 | 31 | |
| 32 | 32 | public function testInputAttribute(): void |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | ->andReturn(['first' => ['foo' => 'bar'], 'second' => ['foo' => 'baz']]); |
| 64 | 64 | |
| 65 | 65 | [$schema, $errors] = $this->mapper->map( |
| 66 | - $filter = new class implements FilterInterface { |
|
| 66 | + $filter = new class implements FilterInterface{ |
|
| 67 | 67 | #[Post] |
| 68 | 68 | public string $username; |
| 69 | 69 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | ->andReturn(['first' => ['foo' => 'bar'], 'second' => ['foo' => 'baz']]); |
| 160 | 160 | |
| 161 | 161 | [$schema, $errors] = $this->mapper->map( |
| 162 | - $filter = new class implements FilterInterface { |
|
| 162 | + $filter = new class implements FilterInterface{ |
|
| 163 | 163 | #[Post] |
| 164 | 164 | public string $username; |
| 165 | 165 | |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | |
| 25 | 25 | $bag = $parameters['filterBag']; |
| 26 | 26 | |
| 27 | - if ($bag->filter instanceof Filter) { |
|
| 27 | + if ($bag->filter instanceof Filter){ |
|
| 28 | 28 | $bag->filter->setData($bag->entity->toArray()); |
| 29 | 29 | } |
| 30 | 30 | |
@@ -24,7 +24,8 @@ |
||
| 24 | 24 | |
| 25 | 25 | $bag = $parameters['filterBag']; |
| 26 | 26 | |
| 27 | - if ($bag->filter instanceof Filter) { |
|
| 27 | + if ($bag->filter instanceof Filter) |
|
| 28 | + { |
|
| 28 | 29 | $bag->filter->setData($bag->entity->toArray()); |
| 29 | 30 | } |
| 30 | 31 | |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | protected function getEventFromTypeDeclaration(\ReflectionMethod $method): array |
| 18 | 18 | { |
| 19 | - if ($method->getNumberOfParameters() > 1) { |
|
| 19 | + if ($method->getNumberOfParameters() > 1){ |
|
| 20 | 20 | throw $this->badClassMethod($method->class, $method->getName()); |
| 21 | 21 | } |
| 22 | 22 | $type = $method->getParameters()[0]->getType(); |
@@ -29,8 +29,8 @@ discard block |
||
| 29 | 29 | }; |
| 30 | 30 | |
| 31 | 31 | $result = []; |
| 32 | - foreach ($eventTypes as $type) { |
|
| 33 | - if ($type->isBuiltin()) { |
|
| 32 | + foreach ($eventTypes as $type){ |
|
| 33 | + if ($type->isBuiltin()){ |
|
| 34 | 34 | continue; |
| 35 | 35 | } |
| 36 | 36 | $result[] = $type->getName(); |
@@ -44,9 +44,9 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | protected function getMethod(string $class, string $name): \ReflectionMethod |
| 46 | 46 | { |
| 47 | - try { |
|
| 47 | + try{ |
|
| 48 | 48 | return new \ReflectionMethod($class, $name); |
| 49 | - } catch (\ReflectionException) { |
|
| 49 | + }catch (\ReflectionException){ |
|
| 50 | 50 | throw $this->badClassMethod($class, $name); |
| 51 | 51 | } |
| 52 | 52 | } |
@@ -16,7 +16,8 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | protected function getEventFromTypeDeclaration(\ReflectionMethod $method): array |
| 18 | 18 | { |
| 19 | - if ($method->getNumberOfParameters() > 1) { |
|
| 19 | + if ($method->getNumberOfParameters() > 1) |
|
| 20 | + { |
|
| 20 | 21 | throw $this->badClassMethod($method->class, $method->getName()); |
| 21 | 22 | } |
| 22 | 23 | $type = $method->getParameters()[0]->getType(); |
@@ -29,8 +30,10 @@ discard block |
||
| 29 | 30 | }; |
| 30 | 31 | |
| 31 | 32 | $result = []; |
| 32 | - foreach ($eventTypes as $type) { |
|
| 33 | - if ($type->isBuiltin()) { |
|
| 33 | + foreach ($eventTypes as $type) |
|
| 34 | + { |
|
| 35 | + if ($type->isBuiltin()) |
|
| 36 | + { |
|
| 34 | 37 | continue; |
| 35 | 38 | } |
| 36 | 39 | $result[] = $type->getName(); |
@@ -44,9 +47,12 @@ discard block |
||
| 44 | 47 | */ |
| 45 | 48 | protected function getMethod(string $class, string $name): \ReflectionMethod |
| 46 | 49 | { |
| 47 | - try { |
|
| 50 | + try |
|
| 51 | + { |
|
| 48 | 52 | return new \ReflectionMethod($class, $name); |
| 49 | - } catch (\ReflectionException) { |
|
| 53 | + } |
|
| 54 | + catch (\ReflectionException) |
|
| 55 | + { |
|
| 50 | 56 | throw $this->badClassMethod($class, $name); |
| 51 | 57 | } |
| 52 | 58 | } |
@@ -20,11 +20,11 @@ |
||
| 20 | 20 | |
| 21 | 21 | public function process(): void |
| 22 | 22 | { |
| 23 | - if ($this->processed) { |
|
| 23 | + if ($this->processed){ |
|
| 24 | 24 | return; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - foreach ($this->processors as $processor) { |
|
| 27 | + foreach ($this->processors as $processor){ |
|
| 28 | 28 | $processor->process(); |
| 29 | 29 | } |
| 30 | 30 | |
@@ -20,11 +20,13 @@ |
||
| 20 | 20 | |
| 21 | 21 | public function process(): void |
| 22 | 22 | { |
| 23 | - if ($this->processed) { |
|
| 23 | + if ($this->processed) |
|
| 24 | + { |
|
| 24 | 25 | return; |
| 25 | 26 | } |
| 26 | 27 | |
| 27 | - foreach ($this->processors as $processor) { |
|
| 28 | + foreach ($this->processors as $processor) |
|
| 29 | + { |
|
| 28 | 30 | $processor->process(); |
| 29 | 31 | } |
| 30 | 32 | |