Skip to content

Commit b42de67

Browse files
committed
added #[\ReturnTypeWillChange]
1 parent 7d31d30 commit b42de67

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+319
-1
lines changed

Slim/App.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public function __construct($container = [])
7171
*
7272
* @return ContainerInterface
7373
*/
74+
#[\ReturnTypeWillChange]
7475
public function getContainer()
7576
{
7677
return $this->container;
@@ -85,6 +86,7 @@ public function getContainer()
8586
*
8687
* @return static
8788
*/
89+
#[\ReturnTypeWillChange]
8890
public function add($callable)
8991
{
9092
return $this->addMiddleware(new DeferredCallable($callable, $this->container));
@@ -101,6 +103,7 @@ public function add($callable)
101103
*
102104
* @throws BadMethodCallException
103105
*/
106+
#[\ReturnTypeWillChange]
104107
public function __call($method, $args)
105108
{
106109
if ($this->container->has($method)) {
@@ -121,6 +124,7 @@ public function __call($method, $args)
121124
*
122125
* @return RouteInterface
123126
*/
127+
#[\ReturnTypeWillChange]
124128
public function get($pattern, $callable)
125129
{
126130
return $this->map(['GET'], $pattern, $callable);
@@ -134,6 +138,7 @@ public function get($pattern, $callable)
134138
*
135139
* @return RouteInterface
136140
*/
141+
#[\ReturnTypeWillChange]
137142
public function post($pattern, $callable)
138143
{
139144
return $this->map(['POST'], $pattern, $callable);
@@ -147,6 +152,7 @@ public function post($pattern, $callable)
147152
*
148153
* @return RouteInterface
149154
*/
155+
#[\ReturnTypeWillChange]
150156
public function put($pattern, $callable)
151157
{
152158
return $this->map(['PUT'], $pattern, $callable);
@@ -160,6 +166,7 @@ public function put($pattern, $callable)
160166
*
161167
* @return RouteInterface
162168
*/
169+
#[\ReturnTypeWillChange]
163170
public function patch($pattern, $callable)
164171
{
165172
return $this->map(['PATCH'], $pattern, $callable);
@@ -173,6 +180,7 @@ public function patch($pattern, $callable)
173180
*
174181
* @return RouteInterface
175182
*/
183+
#[\ReturnTypeWillChange]
176184
public function delete($pattern, $callable)
177185
{
178186
return $this->map(['DELETE'], $pattern, $callable);
@@ -186,6 +194,7 @@ public function delete($pattern, $callable)
186194
*
187195
* @return RouteInterface
188196
*/
197+
#[\ReturnTypeWillChange]
189198
public function options($pattern, $callable)
190199
{
191200
return $this->map(['OPTIONS'], $pattern, $callable);
@@ -199,6 +208,7 @@ public function options($pattern, $callable)
199208
*
200209
* @return RouteInterface
201210
*/
211+
#[\ReturnTypeWillChange]
202212
public function any($pattern, $callable)
203213
{
204214
return $this->map(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'], $pattern, $callable);
@@ -213,6 +223,7 @@ public function any($pattern, $callable)
213223
*
214224
* @return RouteInterface
215225
*/
226+
#[\ReturnTypeWillChange]
216227
public function map(array $methods, $pattern, $callable)
217228
{
218229
if ($callable instanceof Closure) {
@@ -240,6 +251,7 @@ public function map(array $methods, $pattern, $callable)
240251
*
241252
* @return RouteInterface
242253
*/
254+
#[\ReturnTypeWillChange]
243255
public function redirect($from, $to, $status = 302)
244256
{
245257
$handler = function ($request, ResponseInterface $response) use ($to, $status) {
@@ -261,6 +273,7 @@ public function redirect($from, $to, $status = 302)
261273
*
262274
* @return RouteGroupInterface
263275
*/
276+
#[\ReturnTypeWillChange]
264277
public function group($pattern, $callable)
265278
{
266279
/** @var RouterInterface $router */
@@ -288,6 +301,7 @@ public function group($pattern, $callable)
288301
* @throws Exception
289302
* @throws Throwable
290303
*/
304+
#[\ReturnTypeWillChange]
291305
public function run($silent = false)
292306
{
293307
$response = $this->container->get('response');
@@ -338,6 +352,7 @@ public function run($silent = false)
338352
*
339353
* @throws ContainerException
340354
*/
355+
#[\ReturnTypeWillChange]
341356
protected function processInvalidMethod(ServerRequestInterface $request, ResponseInterface $response)
342357
{
343358
$router = $this->container->get('router');
@@ -373,6 +388,7 @@ protected function processInvalidMethod(ServerRequestInterface $request, Respons
373388
* @throws Exception
374389
* @throws Throwable
375390
*/
391+
#[\ReturnTypeWillChange]
376392
public function process(ServerRequestInterface $request, ResponseInterface $response)
377393
{
378394
// Ensure basePath is set
@@ -404,6 +420,7 @@ public function process(ServerRequestInterface $request, ResponseInterface $resp
404420
*
405421
* @param ResponseInterface $response
406422
*/
423+
#[\ReturnTypeWillChange]
407424
public function respond(ResponseInterface $response)
408425
{
409426
// Send response
@@ -484,6 +501,7 @@ public function respond(ResponseInterface $response)
484501
* @throws MethodNotAllowedException
485502
* @throws NotFoundException
486503
*/
504+
#[\ReturnTypeWillChange]
487505
public function __invoke(ServerRequestInterface $request, ResponseInterface $response)
488506
{
489507
// Get the route info
@@ -540,6 +558,7 @@ public function __invoke(ServerRequestInterface $request, ResponseInterface $res
540558
* @throws MethodNotAllowedException
541559
* @throws NotFoundException
542560
*/
561+
#[\ReturnTypeWillChange]
543562
public function subRequest(
544563
$method,
545564
$path,
@@ -573,6 +592,7 @@ public function subRequest(
573592
*
574593
* @return ServerRequestInterface
575594
*/
595+
#[\ReturnTypeWillChange]
576596
protected function dispatchRouterAndPrepareRoute(ServerRequestInterface $request, RouterInterface $router)
577597
{
578598
$routeInfo = $router->dispatch($request);
@@ -604,6 +624,7 @@ protected function dispatchRouterAndPrepareRoute(ServerRequestInterface $request
604624
*
605625
* @throws RuntimeException
606626
*/
627+
#[\ReturnTypeWillChange]
607628
protected function finalize(ResponseInterface $response)
608629
{
609630
// stop PHP sending a Content-Type automatically
@@ -645,6 +666,7 @@ protected function finalize(ResponseInterface $response)
645666
*
646667
* @return bool
647668
*/
669+
#[\ReturnTypeWillChange]
648670
protected function isEmptyResponse(ResponseInterface $response)
649671
{
650672
if (method_exists($response, 'isEmpty')) {
@@ -661,6 +683,7 @@ protected function isEmptyResponse(ResponseInterface $response)
661683
*
662684
* @return bool
663685
*/
686+
#[\ReturnTypeWillChange]
664687
protected function isHeadRequest(RequestInterface $request)
665688
{
666689
$method = $request->getMethod();
@@ -679,6 +702,7 @@ protected function isHeadRequest(RequestInterface $request)
679702
*
680703
* @throws Exception If a handler is needed and not found
681704
*/
705+
#[\ReturnTypeWillChange]
682706
protected function handleException(Exception $e, ServerRequestInterface $request, ResponseInterface $response)
683707
{
684708
if ($e instanceof MethodNotAllowedException) {
@@ -718,6 +742,7 @@ protected function handleException(Exception $e, ServerRequestInterface $request
718742
*
719743
* @throws Throwable
720744
*/
745+
#[\ReturnTypeWillChange]
721746
protected function handlePhpError(Throwable $e, ServerRequestInterface $request, ResponseInterface $response)
722747
{
723748
$handler = 'phpErrorHandler';

Slim/CallableResolver.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public function __construct(ContainerInterface $container)
4545
* @throws RuntimeException If the callable does not exist
4646
* @throws RuntimeException If the callable is not resolvable
4747
*/
48+
#[\ReturnTypeWillChange]
4849
public function resolve($toResolve)
4950
{
5051
if (is_callable($toResolve)) {
@@ -69,6 +70,7 @@ public function resolve($toResolve)
6970
*
7071
* @return array
7172
*/
73+
#[\ReturnTypeWillChange]
7274
protected function parseCallable($toResolve)
7375
{
7476
if (preg_match(self::CALLABLE_PATTERN, $toResolve, $matches)) {
@@ -89,6 +91,7 @@ protected function parseCallable($toResolve)
8991
*
9092
* @throws RuntimeException if the callable does not exist
9193
*/
94+
#[\ReturnTypeWillChange]
9295
protected function resolveCallable($class, $method)
9396
{
9497
if ($this->container->has($class)) {
@@ -107,6 +110,7 @@ protected function resolveCallable($class, $method)
107110
*
108111
* @throws RuntimeException if the callable is not resolvable
109112
*/
113+
#[\ReturnTypeWillChange]
110114
protected function assertCallable($callable)
111115
{
112116
if (!is_callable($callable)) {

Slim/CallableResolverAwareTrait.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ trait CallableResolverAwareTrait
2929
*
3030
* @throws RuntimeException If the string cannot be resolved as a callable
3131
*/
32+
#[\ReturnTypeWillChange]
3233
protected function resolveCallable($callable)
3334
{
3435
if (!$this->container instanceof ContainerInterface) {

Slim/Collection.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function __construct(array $items = [])
3737
/**
3838
* {@inheritdoc}
3939
*/
40+
#[\ReturnTypeWillChange]
4041
public function set($key, $value)
4142
{
4243
$this->data[$key] = $value;
@@ -45,6 +46,7 @@ public function set($key, $value)
4546
/**
4647
* {@inheritdoc}
4748
*/
49+
#[\ReturnTypeWillChange]
4850
public function get($key, $default = null)
4951
{
5052
return $this->has($key) ? $this->data[$key] : $default;
@@ -53,6 +55,7 @@ public function get($key, $default = null)
5355
/**
5456
* {@inheritdoc}
5557
*/
58+
#[\ReturnTypeWillChange]
5659
public function replace(array $items)
5760
{
5861
foreach ($items as $key => $value) {
@@ -63,6 +66,7 @@ public function replace(array $items)
6366
/**
6467
* {@inheritdoc}
6568
*/
69+
#[\ReturnTypeWillChange]
6670
public function all()
6771
{
6872
return $this->data;
@@ -73,6 +77,7 @@ public function all()
7377
*
7478
* @return array The collection's source data keys
7579
*/
80+
#[\ReturnTypeWillChange]
7681
public function keys()
7782
{
7883
return array_keys($this->data);
@@ -81,6 +86,7 @@ public function keys()
8186
/**
8287
* {@inheritdoc}
8388
*/
89+
#[\ReturnTypeWillChange]
8490
public function has($key)
8591
{
8692
return array_key_exists($key, $this->data);
@@ -89,6 +95,7 @@ public function has($key)
8995
/**
9096
* {@inheritdoc}
9197
*/
98+
#[\ReturnTypeWillChange]
9299
public function remove($key)
93100
{
94101
unset($this->data[$key]);
@@ -97,6 +104,7 @@ public function remove($key)
97104
/**
98105
* {@inheritdoc}
99106
*/
107+
#[\ReturnTypeWillChange]
100108
public function clear()
101109
{
102110
$this->data = [];
@@ -109,6 +117,7 @@ public function clear()
109117
*
110118
* @return bool
111119
*/
120+
#[\ReturnTypeWillChange]
112121
public function offsetExists($key)
113122
{
114123
return $this->has($key);
@@ -121,6 +130,7 @@ public function offsetExists($key)
121130
*
122131
* @return mixed The key's value, or the default value
123132
*/
133+
#[\ReturnTypeWillChange]
124134
public function offsetGet($key)
125135
{
126136
return $this->get($key);
@@ -132,6 +142,7 @@ public function offsetGet($key)
132142
* @param string $key The data key
133143
* @param mixed $value The data value
134144
*/
145+
#[\ReturnTypeWillChange]
135146
public function offsetSet($key, $value)
136147
{
137148
$this->set($key, $value);
@@ -142,6 +153,7 @@ public function offsetSet($key, $value)
142153
*
143154
* @param string $key The data key
144155
*/
156+
#[\ReturnTypeWillChange]
145157
public function offsetUnset($key)
146158
{
147159
$this->remove($key);
@@ -152,6 +164,7 @@ public function offsetUnset($key)
152164
*
153165
* @return int
154166
*/
167+
#[\ReturnTypeWillChange]
155168
public function count()
156169
{
157170
return count($this->data);
@@ -162,6 +175,7 @@ public function count()
162175
*
163176
* @return ArrayIterator
164177
*/
178+
#[\ReturnTypeWillChange]
165179
public function getIterator()
166180
{
167181
return new ArrayIterator($this->data);

Slim/Container.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public function __construct(array $values = [])
7070
*
7171
* @return void
7272
*/
73+
#[\ReturnTypeWillChange]
7374
private function registerDefaultServices($userSettings)
7475
{
7576
$defaultSettings = $this->defaultSettings;
@@ -100,6 +101,7 @@ private function registerDefaultServices($userSettings)
100101
* @throws ContainerValueNotFoundException No entry was found for this identifier.
101102
* @throws ContainerExceptionInterface Error while retrieving the entry.
102103
*/
104+
#[\ReturnTypeWillChange]
103105
public function get($id)
104106
{
105107
if (!$this->offsetExists($id)) {
@@ -128,6 +130,7 @@ public function get($id)
128130
*
129131
* @return bool
130132
*/
133+
#[\ReturnTypeWillChange]
131134
private function exceptionThrownByContainer(InvalidArgumentException $exception)
132135
{
133136
$trace = $exception->getTrace()[0];
@@ -143,6 +146,7 @@ private function exceptionThrownByContainer(InvalidArgumentException $exception)
143146
*
144147
* @return boolean
145148
*/
149+
#[\ReturnTypeWillChange]
146150
public function has($id)
147151
{
148152
return $this->offsetExists($id);

Slim/DefaultServicesProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class DefaultServicesProvider
2929
*
3030
* @param Container $container A DI container implementing ArrayAccess and psr/container.
3131
*/
32+
#[\ReturnTypeWillChange]
3233
public function register($container)
3334
{
3435
if (!isset($container['environment'])) {

0 commit comments

Comments
 (0)