From 9f0b5f953040eeb63fcbce013601d44609e8487f Mon Sep 17 00:00:00 2001 From: ziming Date: Sun, 8 Dec 2024 16:28:21 +0800 Subject: [PATCH] Fix some PHP 8.4 deprecation(s) --- psalm.xml.dist | 16 ---------------- src/Exceptions/AccessTokenNotFoundException.php | 2 +- src/Exceptions/InvalidAccessTokenException.php | 2 +- ...alidDataOrSignatureForPersonDataException.php | 2 +- src/Exceptions/InvalidStateException.php | 2 +- .../MyinfoPersonDataNotFoundException.php | 2 +- src/Exceptions/SubNotFoundException.php | 2 +- src/Utils/MyinfoAvailabilityChecker.php | 2 +- 8 files changed, 7 insertions(+), 23 deletions(-) delete mode 100644 psalm.xml.dist diff --git a/psalm.xml.dist b/psalm.xml.dist deleted file mode 100644 index c6df33e..0000000 --- a/psalm.xml.dist +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - diff --git a/src/Exceptions/AccessTokenNotFoundException.php b/src/Exceptions/AccessTokenNotFoundException.php index c545665..0251575 100644 --- a/src/Exceptions/AccessTokenNotFoundException.php +++ b/src/Exceptions/AccessTokenNotFoundException.php @@ -10,7 +10,7 @@ class AccessTokenNotFoundException extends HttpException { - public function __construct(int $statusCode = 404, string $message = 'Access Token Not Found', Exception $previous = null, array $headers = [], ?int $code = 0) + public function __construct(int $statusCode = 404, string $message = 'Access Token Not Found', ?Exception $previous = null, array $headers = [], ?int $code = 0) { parent::__construct($statusCode, $message, $previous, $headers, $code); } diff --git a/src/Exceptions/InvalidAccessTokenException.php b/src/Exceptions/InvalidAccessTokenException.php index 8f528e1..90ace52 100644 --- a/src/Exceptions/InvalidAccessTokenException.php +++ b/src/Exceptions/InvalidAccessTokenException.php @@ -11,7 +11,7 @@ class InvalidAccessTokenException extends HttpException { - public function __construct(int $statusCode = Response::HTTP_BAD_REQUEST, string $message = 'Invalid Access Token', Exception $previous = null, array $headers = [], ?int $code = 0) + public function __construct(int $statusCode = Response::HTTP_BAD_REQUEST, string $message = 'Invalid Access Token', ?Exception $previous = null, array $headers = [], ?int $code = 0) { parent::__construct($statusCode, $message, $previous, $headers, $code); } diff --git a/src/Exceptions/InvalidDataOrSignatureForPersonDataException.php b/src/Exceptions/InvalidDataOrSignatureForPersonDataException.php index 577c429..2a99d1e 100644 --- a/src/Exceptions/InvalidDataOrSignatureForPersonDataException.php +++ b/src/Exceptions/InvalidDataOrSignatureForPersonDataException.php @@ -10,7 +10,7 @@ class InvalidDataOrSignatureForPersonDataException extends HttpException { - public function __construct(int $statusCode = 500, string $message = 'Invalid Data or Signature for Person Data', Exception $previous = null, array $headers = [], ?int $code = 0) + public function __construct(int $statusCode = 500, string $message = 'Invalid Data or Signature for Person Data', ?Exception $previous = null, array $headers = [], ?int $code = 0) { parent::__construct($statusCode, $message, $previous, $headers, $code); } diff --git a/src/Exceptions/InvalidStateException.php b/src/Exceptions/InvalidStateException.php index bbdce07..6eaee14 100644 --- a/src/Exceptions/InvalidStateException.php +++ b/src/Exceptions/InvalidStateException.php @@ -10,7 +10,7 @@ class InvalidStateException extends HttpException { - public function __construct(int $statusCode = 404, string $message = 'Invalid State', Exception $previous = null, array $headers = [], ?int $code = 0) + public function __construct(int $statusCode = 404, string $message = 'Invalid State', ?Exception $previous = null, array $headers = [], ?int $code = 0) { parent::__construct($statusCode, $message, $previous, $headers, $code); } diff --git a/src/Exceptions/MyinfoPersonDataNotFoundException.php b/src/Exceptions/MyinfoPersonDataNotFoundException.php index ee4d5fe..2e35fd2 100644 --- a/src/Exceptions/MyinfoPersonDataNotFoundException.php +++ b/src/Exceptions/MyinfoPersonDataNotFoundException.php @@ -10,7 +10,7 @@ class MyinfoPersonDataNotFoundException extends HttpException { - public function __construct(int $statusCode = 404, string $message = 'MyInfo Person Data not found', Exception $previous = null, array $headers = [], ?int $code = 0) + public function __construct(int $statusCode = 404, string $message = 'MyInfo Person Data not found', ?Exception $previous = null, array $headers = [], ?int $code = 0) { parent::__construct($statusCode, $message, $previous, $headers, $code); } diff --git a/src/Exceptions/SubNotFoundException.php b/src/Exceptions/SubNotFoundException.php index 5cc811a..993474a 100644 --- a/src/Exceptions/SubNotFoundException.php +++ b/src/Exceptions/SubNotFoundException.php @@ -10,7 +10,7 @@ class SubNotFoundException extends HttpException { - public function __construct(int $statusCode = 404, string $message = 'Sub not found', Exception $previous = null, array $headers = [], ?int $code = 0) + public function __construct(int $statusCode = 404, string $message = 'Sub not found', ?Exception $previous = null, array $headers = [], ?int $code = 0) { parent::__construct($statusCode, $message, $previous, $headers, $code); } diff --git a/src/Utils/MyinfoAvailabilityChecker.php b/src/Utils/MyinfoAvailabilityChecker.php index cfc7ed5..77d974e 100644 --- a/src/Utils/MyinfoAvailabilityChecker.php +++ b/src/Utils/MyinfoAvailabilityChecker.php @@ -4,7 +4,7 @@ namespace Ziming\LaravelMyinfoSg\Utils; -use Illuminate\Support\Carbon; +use Carbon\Carbon; /* * @internal