Skip to content

Commit e1245e8

Browse files
committed
fix(Php): No implicit nullable arguments
[php-8-4-compat]
1 parent ba9eb44 commit e1245e8

22 files changed

+70
-44
lines changed

DataCollector/ProfilerDataCollector.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\Serializer\Serializer;
1616
use Symfony\Component\Serializer\Encoder\JsonEncoder;
1717
use Symfony\Component\Stopwatch\Stopwatch;
18+
use Throwable;
1819

1920
/*
2021
* @author Emmanuel VAISSE
@@ -53,7 +54,7 @@ public function __construct(protected bool $debug)
5354
{
5455
}
5556

56-
public function collect(Request $request, Response $response, \Throwable $exception = null): void
57+
public function collect(Request $request, Response $response, ?Throwable $exception = null): void
5758
{
5859
$this->data = array(
5960
'countRequests' => count($this->calls),
@@ -332,7 +333,7 @@ public function fetchResponseInfos(Response $response): array
332333
return $data;
333334
}
334335

335-
public function fetchErrorInfos(\Throwable $error): array
336+
public function fetchErrorInfos(Throwable $error): array
336337
{
337338
return [
338339
'class' => get_class($error),

Http/Exception/BadGatewayHttpException.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@
99
namespace evaisse\SimpleHttpBundle\Http\Exception;
1010

1111

12+
use Exception;
13+
1214
class BadGatewayHttpException extends ServerErrorHttpException
1315
{
1416

1517
/**
1618
* Constructor.
1719
*
1820
* @param string $message The internal exception message
19-
* @param \Exception $previous The previous exception
21+
* @param Exception|null $previous The previous exception
2022
* @param int $code The internal exception code
2123
*/
22-
public function __construct($message = null, \Exception $previous = null, $code = 0)
24+
public function __construct($message = null, ?Exception $previous = null, $code = 0)
2325
{
2426
parent::__construct(502, $message, $previous, array(), $code);
2527
}

Http/Exception/ExpectationFailedHttpException.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@
99
namespace evaisse\SimpleHttpBundle\Http\Exception;
1010

1111

12+
use Exception;
13+
1214
class ExpectationFailedHttpException extends ClientErrorHttpException
1315
{
1416

1517
/**
1618
* Constructor.
1719
*
18-
* @param string $message The internal exception message
19-
* @param \Exception $previous The previous exception
20+
* @param string|null $message The internal exception message
21+
* @param Exception|null $previous The previous exception
2022
* @param int $code The internal exception code
2123
*/
22-
public function __construct($message = null, \Exception $previous = null, $code = 0)
24+
public function __construct($message = null, ?Exception $previous = null, $code = 0)
2325
{
2426
parent::__construct(417, $message, $previous, array(), $code);
2527
}

Http/Exception/ForbiddenHttpException.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@
99
namespace evaisse\SimpleHttpBundle\Http\Exception;
1010

1111

12+
use Exception;
13+
1214
class ForbiddenHttpException extends ClientErrorHttpException
1315
{
1416
/**
1517
* Constructor.
1618
*
1719
* @param string $message The internal exception message
18-
* @param \Exception $previous The previous exception
20+
* @param Exception|null $previous The previous exception
1921
* @param int $code The internal exception code
2022
*/
21-
public function __construct($message = null, \Exception $previous = null, $code = 0)
23+
public function __construct($message = null, ?Exception $previous = null, $code = 0)
2224
{
2325
parent::__construct(403, $message, $previous, array(), $code);
2426
}

Http/Exception/GatewayTimeoutHttpException.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@
99
namespace evaisse\SimpleHttpBundle\Http\Exception;
1010

1111

12+
use Exception;
13+
1214
class GatewayTimeoutHttpException extends ServerErrorHttpException
1315
{
1416

1517
/**
1618
* Constructor.
1719
*
1820
* @param string $message The internal exception message
19-
* @param \Exception $previous The previous exception
21+
* @param Exception|null $previous The previous exception
2022
* @param int $code The internal exception code
2123
*/
22-
public function __construct($message = null, \Exception $previous = null, $code = 0)
24+
public function __construct($message = null, ?Exception $previous = null, $code = 0)
2325
{
2426
parent::__construct(504, $message, $previous, array(), $code);
2527
}

Http/Exception/HttpVersionNotSupportedHttpException.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@
99
namespace evaisse\SimpleHttpBundle\Http\Exception;
1010

1111

12+
use Exception;
13+
1214
class HttpVersionNotSupportedHttpException extends ServerErrorHttpException
1315
{
1416
/**
1517
* Constructor.
1618
*
1719
* @param string $message The internal exception message
18-
* @param \Exception $previous The previous exception
20+
* @param Exception|null $previous The previous exception
1921
* @param int $code The internal exception code
2022
*/
21-
public function __construct($message = null, \Exception $previous = null, $code = 0)
23+
public function __construct($message = null, ?Exception $previous = null, $code = 0)
2224
{
2325
parent::__construct(505, $message, $previous, array(), $code);
2426
}

Http/Exception/InternalServerErrorHttpException.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@
99
namespace evaisse\SimpleHttpBundle\Http\Exception;
1010

1111

12+
use Exception;
13+
1214
class InternalServerErrorHttpException extends ServerErrorHttpException
1315
{
1416

1517
/**
1618
* Constructor.
1719
*
1820
* @param string $message The internal exception message
19-
* @param \Exception $previous The previous exception
21+
* @param Exception|null $previous The previous exception
2022
* @param int $code The internal exception code
2123
*/
22-
public function __construct($message = null, \Exception $previous = null, $code = 0)
24+
public function __construct($message = null, ?Exception $previous = null, $code = 0)
2325
{
2426
parent::__construct(500, $message, $previous, array(), $code);
2527
}

Http/Exception/NotImplementedHttpException.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@
99
namespace evaisse\SimpleHttpBundle\Http\Exception;
1010

1111

12+
use Exception;
13+
1214
class NotImplementedHttpException extends ServerErrorHttpException
1315
{
1416

1517
/**
1618
* Constructor.
1719
*
1820
* @param string $message The internal exception message
19-
* @param \Exception $previous The previous exception
21+
* @param Exception|null $previous The previous exception
2022
* @param int $code The internal exception code
2123
*/
22-
public function __construct($message = null, \Exception $previous = null, $code = 0)
24+
public function __construct($message = null, ?Exception $previous = null, $code = 0)
2325
{
2426
parent::__construct(501, $message, $previous, array(), $code);
2527
}

Http/Exception/ProxyAuthenticationRequiredHttpException.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@
99
namespace evaisse\SimpleHttpBundle\Http\Exception;
1010

1111

12+
use Exception;
13+
1214
class ProxyAuthenticationRequiredHttpException extends ClientErrorHttpException
1315
{
1416

1517
/**
1618
* Constructor.
1719
*
1820
* @param string $message The internal exception message
19-
* @param \Exception $previous The previous exception
21+
* @param Exception|null $previous The previous exception
2022
* @param int $code The internal exception code
2123
*/
22-
public function __construct($message = null, \Exception $previous = null, $code = 0)
24+
public function __construct($message = null, ?Exception $previous = null, $code = 0)
2325
{
2426
parent::__construct(407, $message, $previous, array(), $code);
2527
}

Http/Exception/RequestEntityTooLargeHttpException.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@
99
namespace evaisse\SimpleHttpBundle\Http\Exception;
1010

1111

12+
use Exception;
13+
1214
class RequestEntityTooLargeHttpException extends ClientErrorHttpException
1315
{
1416

1517
/**
1618
* Constructor.
1719
*
1820
* @param string $message The internal exception message
19-
* @param \Exception $previous The previous exception
21+
* @param Exception|null $previous The previous exception
2022
* @param int $code The internal exception code
2123
*/
22-
public function __construct($message = null, \Exception $previous = null, $code = 0)
24+
public function __construct($message = null, ?Exception $previous = null, $code = 0)
2325
{
2426
parent::__construct(413, $message, $previous, array(), $code);
2527
}

0 commit comments

Comments
 (0)