Test Failed
Pull Request — master (#1163)
by Abdul Malik
10:57
created
src/Http/src/Event/RequestHandled.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,6 +12,6 @@
 block discarded – undo
12 12
     public function __construct(
13 13
         public readonly ServerRequestInterface $request,
14 14
         public readonly ResponseInterface $response
15
-    ) {
15
+    ){
16 16
     }
17 17
 }
Please login to merge, or discard this patch.
src/Http/src/Request/InputBag.php 2 patches
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
 {
16 16
     public function __construct(
17 17
         private readonly array $data,
18
-        private readonly int|string $prefix = ''
19
-    ) {
18
+        private readonly int | string $prefix = ''
19
+    ){
20 20
     }
21 21
 
22 22
     public function __debugInfo(): array
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
 
32 32
     public function all(): array
33 33
     {
34
-        try {
34
+        try{
35 35
             return $this->dotGet('');
36
-        } catch (DotNotFoundException) {
36
+        }catch (DotNotFoundException){
37 37
             return [];
38 38
         }
39 39
     }
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     public function fetch(array $keys, bool $fill = false, mixed $filler = null): array
53 53
     {
54 54
         $result = \array_intersect_key($this->all(), \array_flip($keys));
55
-        if (!$fill) {
55
+        if (!$fill){
56 56
             return $result;
57 57
         }
58 58
 
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
     /**
63 63
      * Check if field presented (can be empty) by it's name. Dot notation allowed.
64 64
      */
65
-    public function has(int|string $name): bool
65
+    public function has(int | string $name): bool
66 66
     {
67
-        try {
67
+        try{
68 68
             $this->dotGet($name);
69
-        } catch (DotNotFoundException) {
69
+        }catch (DotNotFoundException){
70 70
             return false;
71 71
         }
72 72
 
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
 
76 76
     public function offsetExists(mixed $offset): bool
77 77
     {
78
-        try {
78
+        try{
79 79
             return !\is_null($this->dotGet($offset));
80
-        } catch (DotNotFoundException) {
80
+        }catch (DotNotFoundException){
81 81
             return false;
82 82
         }
83 83
     }
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
     /**
91 91
      * Get property or return default value. Dot notation allowed.
92 92
      */
93
-    public function get(int|string $name, mixed $default = null): mixed
93
+    public function get(int | string $name, mixed $default = null): mixed
94 94
     {
95
-        try {
95
+        try{
96 96
             return $this->dotGet($name);
97
-        } catch (DotNotFoundException) {
97
+        }catch (DotNotFoundException){
98 98
             return $default;
99 99
         }
100 100
     }
@@ -120,20 +120,20 @@  discard block
 block discarded – undo
120 120
      *
121 121
      * @throws DotNotFoundException
122 122
      */
123
-    private function dotGet(int|string $name): mixed
123
+    private function dotGet(int | string $name): mixed
124 124
     {
125 125
         $data = $this->data;
126 126
 
127 127
         //Generating path relative to a given name and prefix
128
-        $path = (empty($this->prefix) ? '' : $this->prefix . '.') . $name;
129
-        if (empty($path)) {
128
+        $path = (empty($this->prefix) ? '' : $this->prefix.'.').$name;
129
+        if (empty($path)){
130 130
             return $data;
131 131
         }
132 132
 
133 133
         $path = \explode('.', \rtrim($path, '.'));
134 134
 
135
-        foreach ($path as $step) {
136
-            if (!\is_array($data) || !\array_key_exists($step, $data)) {
135
+        foreach ($path as $step){
136
+            if (!\is_array($data) || !\array_key_exists($step, $data)){
137 137
                 throw new DotNotFoundException(\sprintf("Unable to find requested element '%s'.", $name));
138 138
             }
139 139
 
Please login to merge, or discard this patch.
Braces   +28 added lines, -12 removed lines patch added patch discarded remove patch
@@ -31,9 +31,12 @@  discard block
 block discarded – undo
31 31
 
32 32
     public function all(): array
33 33
     {
34
-        try {
34
+        try
35
+        {
35 36
             return $this->dotGet('');
36
-        } catch (DotNotFoundException) {
37
+        }
38
+        catch (DotNotFoundException)
39
+        {
37 40
             return [];
38 41
         }
39 42
     }
@@ -52,7 +55,8 @@  discard block
 block discarded – undo
52 55
     public function fetch(array $keys, bool $fill = false, mixed $filler = null): array
53 56
     {
54 57
         $result = \array_intersect_key($this->all(), \array_flip($keys));
55
-        if (!$fill) {
58
+        if (!$fill)
59
+        {
56 60
             return $result;
57 61
         }
58 62
 
@@ -64,9 +68,12 @@  discard block
 block discarded – undo
64 68
      */
65 69
     public function has(int|string $name): bool
66 70
     {
67
-        try {
71
+        try
72
+        {
68 73
             $this->dotGet($name);
69
-        } catch (DotNotFoundException) {
74
+        }
75
+        catch (DotNotFoundException)
76
+        {
70 77
             return false;
71 78
         }
72 79
 
@@ -75,9 +82,12 @@  discard block
 block discarded – undo
75 82
 
76 83
     public function offsetExists(mixed $offset): bool
77 84
     {
78
-        try {
85
+        try
86
+        {
79 87
             return !\is_null($this->dotGet($offset));
80
-        } catch (DotNotFoundException) {
88
+        }
89
+        catch (DotNotFoundException)
90
+        {
81 91
             return false;
82 92
         }
83 93
     }
@@ -92,9 +102,12 @@  discard block
 block discarded – undo
92 102
      */
93 103
     public function get(int|string $name, mixed $default = null): mixed
94 104
     {
95
-        try {
105
+        try
106
+        {
96 107
             return $this->dotGet($name);
97
-        } catch (DotNotFoundException) {
108
+        }
109
+        catch (DotNotFoundException)
110
+        {
98 111
             return $default;
99 112
         }
100 113
     }
@@ -126,14 +139,17 @@  discard block
 block discarded – undo
126 139
 
127 140
         //Generating path relative to a given name and prefix
128 141
         $path = (empty($this->prefix) ? '' : $this->prefix . '.') . $name;
129
-        if (empty($path)) {
142
+        if (empty($path))
143
+        {
130 144
             return $data;
131 145
         }
132 146
 
133 147
         $path = \explode('.', \rtrim($path, '.'));
134 148
 
135
-        foreach ($path as $step) {
136
-            if (!\is_array($data) || !\array_key_exists($step, $data)) {
149
+        foreach ($path as $step)
150
+        {
151
+            if (!\is_array($data) || !\array_key_exists($step, $data))
152
+            {
137 153
                 throw new DotNotFoundException(\sprintf("Unable to find requested element '%s'.", $name));
138 154
             }
139 155
 
Please login to merge, or discard this patch.
src/Http/src/Request/ServerBag.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,14 +10,14 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Http/src/Request/FilesBag.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Http/src/Request/HeadersBag.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -10,19 +10,19 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
src/Http/src/Middleware/JsonPayloadMiddleware.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public function __construct(
23 23
         private readonly JsonPayloadConfig $config
24
-    ) {
24
+    ){
25 25
     }
26 26
 
27 27
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
28 28
     {
29
-        if ($this->isJsonPayload($request)) {
29
+        if ($this->isJsonPayload($request)){
30 30
             $body = (string)$request->getBody();
31
-            if ($body !== '') {
31
+            if ($body !== ''){
32 32
                 $request = $request->withParsedBody(\json_decode($body, true));
33
-                if (\json_last_error() !== 0) {
33
+                if (\json_last_error() !== 0){
34 34
                     throw new ClientException(400, 'invalid json payload');
35 35
                 }
36 36
             }
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
     {
44 44
         $contentType = $request->getHeaderLine('Content-Type');
45 45
 
46
-        foreach ($this->config->getContentTypes() as $allowedType) {
47
-            if (\stripos($contentType, $allowedType) === 0) {
46
+        foreach ($this->config->getContentTypes() as $allowedType){
47
+            if (\stripos($contentType, $allowedType) === 0){
48 48
                 return true;
49 49
             }
50 50
         }
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,11 +26,14 @@  discard block
 block discarded – undo
26 26
 
27 27
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
28 28
     {
29
-        if ($this->isJsonPayload($request)) {
29
+        if ($this->isJsonPayload($request))
30
+        {
30 31
             $body = (string)$request->getBody();
31
-            if ($body !== '') {
32
+            if ($body !== '')
33
+            {
32 34
                 $request = $request->withParsedBody(\json_decode($body, true));
33
-                if (\json_last_error() !== 0) {
35
+                if (\json_last_error() !== 0)
36
+                {
34 37
                     throw new ClientException(400, 'invalid json payload');
35 38
                 }
36 39
             }
@@ -43,8 +46,10 @@  discard block
 block discarded – undo
43 46
     {
44 47
         $contentType = $request->getHeaderLine('Content-Type');
45 48
 
46
-        foreach ($this->config->getContentTypes() as $allowedType) {
47
-            if (\stripos($contentType, $allowedType) === 0) {
49
+        foreach ($this->config->getContentTypes() as $allowedType)
50
+        {
51
+            if (\stripos($contentType, $allowedType) === 0)
52
+            {
48 53
                 return true;
49 54
             }
50 55
         }
Please login to merge, or discard this patch.
src/Http/src/CallableHandler.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     public function __construct(
25 25
         callable $callable,
26 26
         private readonly ResponseFactoryInterface $responseFactory
27
-    ) {
27
+    ){
28 28
         $this->callable = $callable;
29 29
     }
30 30
 
@@ -39,21 +39,21 @@  discard block
 block discarded – undo
39 39
         $output = $result = null;
40 40
 
41 41
         $response = $this->responseFactory->createResponse(200);
42
-        try {
42
+        try{
43 43
             $result = \call_user_func($this->callable, $request, $response);
44
-        } catch (\Throwable $e) {
44
+        }catch (\Throwable $e){
45 45
             \ob_get_clean();
46 46
             throw $e;
47
-        } finally {
48
-            while (\ob_get_level() > $outputLevel + 1) {
49
-                $output = \ob_get_clean() . $output;
47
+        }finally{
48
+            while (\ob_get_level() > $outputLevel + 1){
49
+                $output = \ob_get_clean().$output;
50 50
             }
51 51
         }
52 52
 
53 53
         return $this->wrapResponse(
54 54
             $response,
55 55
             $result,
56
-            \ob_get_clean() . $output
56
+            \ob_get_clean().$output
57 57
         );
58 58
     }
59 59
 
@@ -66,17 +66,17 @@  discard block
 block discarded – undo
66 66
      */
67 67
     private function wrapResponse(Response $response, mixed $result = null, string $output = ''): Response
68 68
     {
69
-        if ($result instanceof Response) {
70
-            if (!empty($output) && $result->getBody()->isWritable()) {
69
+        if ($result instanceof Response){
70
+            if (!empty($output) && $result->getBody()->isWritable()){
71 71
                 $result->getBody()->write($output);
72 72
             }
73 73
 
74 74
             return $result;
75 75
         }
76 76
 
77
-        if (\is_array($result) || $result instanceof \JsonSerializable) {
77
+        if (\is_array($result) || $result instanceof \JsonSerializable){
78 78
             $response = $this->writeJson($response, $result);
79
-        } else {
79
+        }else{
80 80
             $response->getBody()->write((string)$result);
81 81
         }
82 82
 
Please login to merge, or discard this patch.
Braces   +19 added lines, -8 removed lines patch added patch discarded remove patch
@@ -39,13 +39,19 @@  discard block
 block discarded – undo
39 39
         $output = $result = null;
40 40
 
41 41
         $response = $this->responseFactory->createResponse(200);
42
-        try {
42
+        try
43
+        {
43 44
             $result = \call_user_func($this->callable, $request, $response);
44
-        } catch (\Throwable $e) {
45
+        }
46
+        catch (\Throwable $e)
47
+        {
45 48
             \ob_get_clean();
46 49
             throw $e;
47
-        } finally {
48
-            while (\ob_get_level() > $outputLevel + 1) {
50
+        }
51
+        finally
52
+        {
53
+            while (\ob_get_level() > $outputLevel + 1)
54
+            {
49 55
                 $output = \ob_get_clean() . $output;
50 56
             }
51 57
         }
@@ -66,17 +72,22 @@  discard block
 block discarded – undo
66 72
      */
67 73
     private function wrapResponse(Response $response, mixed $result = null, string $output = ''): Response
68 74
     {
69
-        if ($result instanceof Response) {
70
-            if (!empty($output) && $result->getBody()->isWritable()) {
75
+        if ($result instanceof Response)
76
+        {
77
+            if (!empty($output) && $result->getBody()->isWritable())
78
+            {
71 79
                 $result->getBody()->write($output);
72 80
             }
73 81
 
74 82
             return $result;
75 83
         }
76 84
 
77
-        if (\is_array($result) || $result instanceof \JsonSerializable) {
85
+        if (\is_array($result) || $result instanceof \JsonSerializable)
86
+        {
78 87
             $response = $this->writeJson($response, $result);
79
-        } else {
88
+        }
89
+        else
90
+        {
80 91
             $response->getBody()->write((string)$result);
81 92
         }
82 93
 
Please login to merge, or discard this patch.
src/Http/src/Header/AcceptHeaderItem.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -27,17 +27,17 @@  discard block
 block discarded – undo
27 27
 
28 28
     public function __toString(): string
29 29
     {
30
-        if ($this->value === '') {
30
+        if ($this->value === ''){
31 31
             return '';
32 32
         }
33 33
 
34 34
         $parts = [$this->value];
35 35
 
36
-        if ($this->quality < 1) {
36
+        if ($this->quality < 1){
37 37
             $parts[] = \sprintf('q=%s', $this->quality);
38 38
         }
39 39
 
40
-        foreach ($this->getParams() as $name => $value) {
40
+        foreach ($this->getParams() as $name => $value){
41 41
             $parts[] = \sprintf('%s=%s', $name, $value);
42 42
         }
43 43
 
@@ -55,20 +55,20 @@  discard block
 block discarded – undo
55 55
         $quality = 1.0;
56 56
         $params = [];
57 57
 
58
-        foreach ($elements as $element) {
58
+        foreach ($elements as $element){
59 59
             $parsed = \explode('=', \trim($element), 2);
60 60
 
61 61
             // Wrong params must be ignored
62
-            if (\count($parsed) !== 2) {
62
+            if (\count($parsed) !== 2){
63 63
                 continue;
64 64
             }
65 65
 
66 66
             $name = \trim($parsed[0]);
67 67
             $value = \trim($parsed[1]);
68 68
 
69
-            if (\strcasecmp($name, 'q') === 0) {
69
+            if (\strcasecmp($name, 'q') === 0){
70 70
                 $quality = (float)$value;
71
-            } else {
71
+            }else{
72 72
                 $params[$name] = $value;
73 73
             }
74 74
         }
@@ -127,15 +127,15 @@  discard block
 block discarded – undo
127 127
 
128 128
     private function setParams(array $params): void
129 129
     {
130
-        foreach ($params as $name => $value) {
131
-            if (\is_numeric($name) || !\is_scalar($value)) {
130
+        foreach ($params as $name => $value){
131
+            if (\is_numeric($name) || !\is_scalar($value)){
132 132
                 continue;
133 133
             }
134 134
 
135 135
             $name = \trim($name);
136 136
             $value = \trim((string)$value);
137 137
 
138
-            if ($name === '' || $value === '') {
138
+            if ($name === '' || $value === ''){
139 139
                 continue;
140 140
             }
141 141
 
Please login to merge, or discard this patch.
Braces   +21 added lines, -10 removed lines patch added patch discarded remove patch
@@ -27,17 +27,20 @@  discard block
 block discarded – undo
27 27
 
28 28
     public function __toString(): string
29 29
     {
30
-        if ($this->value === '') {
30
+        if ($this->value === '')
31
+        {
31 32
             return '';
32 33
         }
33 34
 
34 35
         $parts = [$this->value];
35 36
 
36
-        if ($this->quality < 1) {
37
+        if ($this->quality < 1)
38
+        {
37 39
             $parts[] = \sprintf('q=%s', $this->quality);
38 40
         }
39 41
 
40
-        foreach ($this->getParams() as $name => $value) {
42
+        foreach ($this->getParams() as $name => $value)
43
+        {
41 44
             $parts[] = \sprintf('%s=%s', $name, $value);
42 45
         }
43 46
 
@@ -55,20 +58,25 @@  discard block
 block discarded – undo
55 58
         $quality = 1.0;
56 59
         $params = [];
57 60
 
58
-        foreach ($elements as $element) {
61
+        foreach ($elements as $element)
62
+        {
59 63
             $parsed = \explode('=', \trim($element), 2);
60 64
 
61 65
             // Wrong params must be ignored
62
-            if (\count($parsed) !== 2) {
66
+            if (\count($parsed) !== 2)
67
+            {
63 68
                 continue;
64 69
             }
65 70
 
66 71
             $name = \trim($parsed[0]);
67 72
             $value = \trim($parsed[1]);
68 73
 
69
-            if (\strcasecmp($name, 'q') === 0) {
74
+            if (\strcasecmp($name, 'q') === 0)
75
+            {
70 76
                 $quality = (float)$value;
71
-            } else {
77
+            }
78
+            else
79
+            {
72 80
                 $params[$name] = $value;
73 81
             }
74 82
         }
@@ -127,15 +135,18 @@  discard block
 block discarded – undo
127 135
 
128 136
     private function setParams(array $params): void
129 137
     {
130
-        foreach ($params as $name => $value) {
131
-            if (\is_numeric($name) || !\is_scalar($value)) {
138
+        foreach ($params as $name => $value)
139
+        {
140
+            if (\is_numeric($name) || !\is_scalar($value))
141
+            {
132 142
                 continue;
133 143
             }
134 144
 
135 145
             $name = \trim($name);
136 146
             $value = \trim((string)$value);
137 147
 
138
-            if ($name === '' || $value === '') {
148
+            if ($name === '' || $value === '')
149
+            {
139 150
                 continue;
140 151
             }
141 152
 
Please login to merge, or discard this patch.
src/Http/src/ResponseWrapper.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         private readonly ResponseFactoryInterface $responseFactory,
26 26
         private readonly StreamFactoryInterface $streamFactory,
27 27
         private readonly FilesInterface $files
28
-    ) {
28
+    ){
29 29
     }
30 30
 
31 31
     public function create(int $code): ResponseInterface
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      * @throws ResponseException
40 40
      */
41 41
     public function redirect(
42
-        string|UriInterface $uri,
42
+        string | UriInterface $uri,
43 43
         int $code = 302
44 44
     ): ResponseInterface {
45 45
         return $this->responseFactory->createResponse($code)->withHeader('Location', (string)$uri);
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
         string $name = '',
68 68
         string $mime = 'application/octet-stream'
69 69
     ): ResponseInterface {
70
-        if (empty($name)) {
71
-            if (!\is_string($filename)) {
70
+        if (empty($name)){
71
+            if (!\is_string($filename)){
72 72
                 throw new ResponseException('Unable to resolve public filename');
73 73
             }
74 74
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         $response = $response->withHeader('Content-Length', (string)$stream->getSize());
83 83
         $response = $response->withHeader(
84 84
             'Content-Disposition',
85
-            'attachment; filename="' . \addcslashes($name, '"') . '"'
85
+            'attachment; filename="'.\addcslashes($name, '"').'"'
86 86
         );
87 87
 
88 88
         return $response->withBody($stream);
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,8 +67,10 @@
 block discarded – undo
67 67
         string $name = '',
68 68
         string $mime = 'application/octet-stream'
69 69
     ): ResponseInterface {
70
-        if (empty($name)) {
71
-            if (!\is_string($filename)) {
70
+        if (empty($name))
71
+        {
72
+            if (!\is_string($filename))
73
+            {
72 74
                 throw new ResponseException('Unable to resolve public filename');
73 75
             }
74 76
 
Please login to merge, or discard this patch.