Skip to content

Commit 7d31d30

Browse files
committed
return types were removed
1 parent 741ee5a commit 7d31d30

File tree

7 files changed

+67
-91
lines changed

7 files changed

+67
-91
lines changed

Slim/App.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ protected function isEmptyResponse(ResponseInterface $response)
661661
*
662662
* @return bool
663663
*/
664-
protected function isHeadRequest(RequestInterface $request): bool
664+
protected function isHeadRequest(RequestInterface $request)
665665
{
666666
$method = $request->getMethod();
667667
return strtoupper(isset($method) ? $method : '') === 'HEAD';

Slim/Collection.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function clear()
109109
*
110110
* @return bool
111111
*/
112-
public function offsetExists($key): bool
112+
public function offsetExists($key)
113113
{
114114
return $this->has($key);
115115
}
@@ -121,7 +121,7 @@ public function offsetExists($key): bool
121121
*
122122
* @return mixed The key's value, or the default value
123123
*/
124-
public function offsetGet($key): mixed
124+
public function offsetGet($key)
125125
{
126126
return $this->get($key);
127127
}
@@ -132,7 +132,7 @@ public function offsetGet($key): mixed
132132
* @param string $key The data key
133133
* @param mixed $value The data value
134134
*/
135-
public function offsetSet($key, $value): void
135+
public function offsetSet($key, $value)
136136
{
137137
$this->set($key, $value);
138138
}
@@ -142,7 +142,7 @@ public function offsetSet($key, $value): void
142142
*
143143
* @param string $key The data key
144144
*/
145-
public function offsetUnset($key): void
145+
public function offsetUnset($key)
146146
{
147147
$this->remove($key);
148148
}
@@ -152,7 +152,7 @@ public function offsetUnset($key): void
152152
*
153153
* @return int
154154
*/
155-
public function count(): int
155+
public function count()
156156
{
157157
return count($this->data);
158158
}
@@ -162,7 +162,7 @@ public function count(): int
162162
*
163163
* @return ArrayIterator
164164
*/
165-
public function getIterator(): ArrayIterator
165+
public function getIterator()
166166
{
167167
return new ArrayIterator($this->data);
168168
}

Slim/Container.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function __construct(array $values = [])
7070
*
7171
* @return void
7272
*/
73-
private function registerDefaultServices($userSettings): void
73+
private function registerDefaultServices($userSettings)
7474
{
7575
$defaultSettings = $this->defaultSettings;
7676

@@ -100,7 +100,7 @@ private function registerDefaultServices($userSettings): void
100100
* @throws ContainerValueNotFoundException No entry was found for this identifier.
101101
* @throws ContainerExceptionInterface Error while retrieving the entry.
102102
*/
103-
public function get($id): mixed
103+
public function get($id)
104104
{
105105
if (!$this->offsetExists($id)) {
106106
throw new ContainerValueNotFoundException(sprintf('Identifier "%s" is not defined.', $id));
@@ -128,7 +128,7 @@ public function get($id): mixed
128128
*
129129
* @return bool
130130
*/
131-
private function exceptionThrownByContainer(InvalidArgumentException $exception): bool
131+
private function exceptionThrownByContainer(InvalidArgumentException $exception)
132132
{
133133
$trace = $exception->getTrace()[0];
134134

@@ -143,7 +143,7 @@ private function exceptionThrownByContainer(InvalidArgumentException $exception)
143143
*
144144
* @return boolean
145145
*/
146-
public function has($id): bool
146+
public function has($id)
147147
{
148148
return $this->offsetExists($id);
149149
}

Slim/Handlers/AbstractError.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct($displayErrorDetails = false)
3232
*
3333
* @return void
3434
*/
35-
protected function writeToErrorLog($throwable): void
35+
protected function writeToErrorLog($throwable)
3636
{
3737
if ($this->displayErrorDetails) {
3838
return;
@@ -57,7 +57,7 @@ protected function writeToErrorLog($throwable): void
5757
*
5858
* @return string
5959
*/
60-
protected function renderThrowableAsText($throwable): string
60+
protected function renderThrowableAsText($throwable)
6161
{
6262
$text = sprintf('Type: %s' . PHP_EOL, get_class($throwable));
6363

Slim/Http/Request.php

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,6 @@ public function isXhr()
475475
*
476476
* @return string
477477
*/
478-
#[\ReturnTypeWillChange]
479478
public function getRequestTarget()
480479
{
481480
if ($this->requestTarget) {
@@ -524,7 +523,6 @@ public function getRequestTarget()
524523
*
525524
* @throws InvalidArgumentException if the request target is invalid
526525
*/
527-
#[\ReturnTypeWillChange]
528526
public function withRequestTarget($requestTarget)
529527
{
530528
if (preg_match('#\s#', $requestTarget)) {
@@ -547,7 +545,6 @@ public function withRequestTarget($requestTarget)
547545
*
548546
* @return UriInterface
549547
*/
550-
#[\ReturnTypeWillChange]
551548
public function getUri()
552549
{
553550
return $this->uri;
@@ -585,7 +582,6 @@ public function getUri()
585582
*
586583
* @return static
587584
*/
588-
#[\ReturnTypeWillChange]
589585
public function withUri(UriInterface $uri, $preserveHost = false)
590586
{
591587
$clone = clone $this;
@@ -611,7 +607,6 @@ public function withUri(UriInterface $uri, $preserveHost = false)
611607
*
612608
* @return string|null
613609
*/
614-
#[\ReturnTypeWillChange]
615610
public function getContentType()
616611
{
617612
$result = $this->getHeader('Content-Type');
@@ -626,7 +621,6 @@ public function getContentType()
626621
*
627622
* @return string|null
628623
*/
629-
#[\ReturnTypeWillChange]
630624
public function getMediaType()
631625
{
632626
$contentType = $this->getContentType();
@@ -646,7 +640,6 @@ public function getMediaType()
646640
*
647641
* @return string[]
648642
*/
649-
#[\ReturnTypeWillChange]
650643
public function getMediaTypeParams()
651644
{
652645
$contentType = $this->getContentType();
@@ -670,7 +663,6 @@ public function getMediaTypeParams()
670663
*
671664
* @return string|null
672665
*/
673-
#[\ReturnTypeWillChange]
674666
public function getContentCharset()
675667
{
676668
$mediaTypeParams = $this->getMediaTypeParams();
@@ -688,7 +680,6 @@ public function getContentCharset()
688680
*
689681
* @return int|null
690682
*/
691-
#[\ReturnTypeWillChange]
692683
public function getContentLength()
693684
{
694685
$result = $this->headers->get('Content-Length');
@@ -705,7 +696,6 @@ public function getContentLength()
705696
*
706697
* @return array
707698
*/
708-
#[\ReturnTypeWillChange]
709699
public function getCookieParams()
710700
{
711701
return $this->cookies;
@@ -721,7 +711,6 @@ public function getCookieParams()
721711
*
722712
* @return mixed
723713
*/
724-
#[\ReturnTypeWillChange]
725714
public function getCookieParam($key, $default = null)
726715
{
727716
$cookies = $this->getCookieParams();
@@ -751,7 +740,6 @@ public function getCookieParam($key, $default = null)
751740
*
752741
* @return static
753742
*/
754-
#[\ReturnTypeWillChange]
755743
public function withCookieParams(array $cookies)
756744
{
757745
$clone = clone $this;
@@ -772,7 +760,6 @@ public function withCookieParams(array $cookies)
772760
*
773761
* @return array
774762
*/
775-
#[\ReturnTypeWillChange]
776763
public function getQueryParams()
777764
{
778765
if (is_array($this->queryParams)) {
@@ -811,7 +798,6 @@ public function getQueryParams()
811798
*
812799
* @return static
813800
*/
814-
#[\ReturnTypeWillChange]
815801
public function withQueryParams(array $query)
816802
{
817803
$clone = clone $this;
@@ -831,7 +817,6 @@ public function withQueryParams(array $query)
831817
*
832818
* @return array
833819
*/
834-
#[\ReturnTypeWillChange]
835820
public function getUploadedFiles()
836821
{
837822
return $this->uploadedFiles;
@@ -850,7 +835,6 @@ public function getUploadedFiles()
850835
*
851836
* @throws InvalidArgumentException if an invalid structure is provided.
852837
*/
853-
#[\ReturnTypeWillChange]
854838
public function withUploadedFiles(array $uploadedFiles)
855839
{
856840
$clone = clone $this;
@@ -868,7 +852,6 @@ public function withUploadedFiles(array $uploadedFiles)
868852
*
869853
* @return array
870854
*/
871-
#[\ReturnTypeWillChange]
872855
public function getServerParams()
873856
{
874857
return $this->serverParams;
@@ -884,7 +867,6 @@ public function getServerParams()
884867
*
885868
* @return mixed
886869
*/
887-
#[\ReturnTypeWillChange]
888870
public function getServerParam($key, $default = null)
889871
{
890872
$serverParams = $this->getServerParams();
@@ -903,7 +885,6 @@ public function getServerParam($key, $default = null)
903885
*
904886
* @return array
905887
*/
906-
#[\ReturnTypeWillChange]
907888
public function getAttributes()
908889
{
909890
return $this->attributes->all();
@@ -926,7 +907,6 @@ public function getAttributes()
926907
*
927908
* @return mixed
928909
*/
929-
#[\ReturnTypeWillChange]
930910
public function getAttribute($name, $default = null)
931911
{
932912
return $this->attributes->get($name, $default);
@@ -949,7 +929,6 @@ public function getAttribute($name, $default = null)
949929
*
950930
* @return static
951931
*/
952-
#[\ReturnTypeWillChange]
953932
public function withAttribute($name, $value)
954933
{
955934
$clone = clone $this;
@@ -974,7 +953,6 @@ public function withAttribute($name, $value)
974953
*
975954
* @return static
976955
*/
977-
#[\ReturnTypeWillChange]
978956
public function withAttributes(array $attributes)
979957
{
980958
$clone = clone $this;
@@ -999,7 +977,6 @@ public function withAttributes(array $attributes)
999977
*
1000978
* @return static
1001979
*/
1002-
#[\ReturnTypeWillChange]
1003980
public function withoutAttribute($name)
1004981
{
1005982
$clone = clone $this;
@@ -1024,7 +1001,6 @@ public function withoutAttribute($name)
10241001
*
10251002
* @throws RuntimeException if the request body media type parser returns an invalid value
10261003
*/
1027-
#[\ReturnTypeWillChange]
10281004
public function getParsedBody()
10291005
{
10301006
if ($this->bodyParsed !== false) {
@@ -1091,7 +1067,7 @@ public function getParsedBody()
10911067
* @throws InvalidArgumentException if an unsupported argument type is
10921068
* provided.
10931069
*/
1094-
public function withParsedBody($data): Request|static
1070+
public function withParsedBody($data)
10951071
{
10961072
if (!is_null($data) && !is_object($data) && !is_array($data)) {
10971073
throw new InvalidArgumentException('Parsed body value must be an array, an object, or null');
@@ -1110,7 +1086,7 @@ public function withParsedBody($data): Request|static
11101086
*
11111087
* @return $this
11121088
*/
1113-
public function reparseBody(): self
1089+
public function reparseBody()
11141090
{
11151091
$this->bodyParsed = false;
11161092

@@ -1125,7 +1101,7 @@ public function reparseBody(): self
11251101
* @param string $mediaType A HTTP media type (excluding content-type params).
11261102
* @param callable $callable A callable that returns parsed contents for media type.
11271103
*/
1128-
public function registerMediaTypeParser($mediaType, callable $callable): void
1104+
public function registerMediaTypeParser($mediaType, callable $callable)
11291105
{
11301106
if ($callable instanceof Closure) {
11311107
$callable = $callable->bindTo($this);
@@ -1143,7 +1119,7 @@ public function registerMediaTypeParser($mediaType, callable $callable): void
11431119
*
11441120
* @return mixed
11451121
*/
1146-
public function getParam($key, $default = null): mixed
1122+
public function getParam($key, $default = null)
11471123
{
11481124
$postParams = $this->getParsedBody();
11491125
$getParams = $this->getQueryParams();
@@ -1169,7 +1145,7 @@ public function getParam($key, $default = null): mixed
11691145
*
11701146
* @return mixed
11711147
*/
1172-
public function getParsedBodyParam($key, $default = null): mixed
1148+
public function getParsedBodyParam($key, $default = null)
11731149
{
11741150
$postParams = $this->getParsedBody();
11751151
$result = $default;
@@ -1192,7 +1168,7 @@ public function getParsedBodyParam($key, $default = null): mixed
11921168
*
11931169
* @return mixed
11941170
*/
1195-
public function getQueryParam($key, $default = null): mixed
1171+
public function getQueryParam($key, $default = null)
11961172
{
11971173
$getParams = $this->getQueryParams();
11981174
$result = $default;
@@ -1212,7 +1188,7 @@ public function getQueryParam($key, $default = null): mixed
12121188
*
12131189
* @return mixed[]
12141190
*/
1215-
public function getParams(array $only = null): array
1191+
public function getParams(array $only = null)
12161192
{
12171193
$params = $this->getQueryParams();
12181194
$postParams = $this->getParsedBody();
@@ -1233,7 +1209,7 @@ public function getParams(array $only = null): array
12331209
return $params;
12341210
}
12351211

1236-
private static function disableXmlEntityLoader($disable): bool
1212+
private static function disableXmlEntityLoader($disable)
12371213
{
12381214
if (\LIBXML_VERSION >= 20900) {
12391215
// libxml >= 2.9.0 disables entity loading by default, so it is

0 commit comments

Comments
 (0)