From 534ac510f7d77fdc754d34c127681a818b5bb400 Mon Sep 17 00:00:00 2001 From: KyleKatarn Date: Thu, 27 May 2021 00:32:02 +0200 Subject: [PATCH] Fix typings --- src/Carbon/CarbonInterval.php | 4 ++-- src/Carbon/Traits/Options.php | 8 ++++---- tests/Carbon/CreateStrictTest.php | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Carbon/CarbonInterval.php b/src/Carbon/CarbonInterval.php index 7415859d4d..fb85df80ef 100644 --- a/src/Carbon/CarbonInterval.php +++ b/src/Carbon/CarbonInterval.php @@ -667,9 +667,9 @@ public function clone(): self * @param string $method magic method name called * @param array $parameters parameters list * - * @return static|null + * @return static|mixed|null */ - public static function __callStatic(string $method, array $parameters): ?self + public static function __callStatic(string $method, array $parameters) { try { $interval = new static(0); diff --git a/src/Carbon/Traits/Options.php b/src/Carbon/Traits/Options.php index aa65a24a8d..bc5db7ac6a 100644 --- a/src/Carbon/Traits/Options.php +++ b/src/Carbon/Traits/Options.php @@ -180,16 +180,16 @@ trait Options /** * Format to use on string cast. * - * @var string|null + * @var string|callable|null */ - protected ?string $localToStringFormat = null; + protected $localToStringFormat = null; /** * Format to use on JSON serialization. * - * @var string|null + * @var string|callable|null */ - protected ?string $localSerializer = null; + protected $localSerializer = null; /** * Instance-specific macros. diff --git a/tests/Carbon/CreateStrictTest.php b/tests/Carbon/CreateStrictTest.php index bae93fc0ef..6e026a610e 100644 --- a/tests/Carbon/CreateStrictTest.php +++ b/tests/Carbon/CreateStrictTest.php @@ -22,7 +22,7 @@ public function testCreateStrictThrowsExceptionForSecondLowerThanZero() { $this->expectException(OutOfRangeException::class); $this->expectExceptionMessage( - 'second must be between 0 and 99, -1 given' + 'second must be between 0 and 99, -1 given', ); Carbon::createStrict(null, null, null, null, null, -1); @@ -32,7 +32,7 @@ public function testCreateStrictThrowsExceptionForMonthOverRange() { $this->expectException(OutOfRangeException::class); $this->expectExceptionMessage( - 'month must be between 0 and 99, 9001 given' + 'month must be between 0 and 99, 9001 given', ); Carbon::createStrict(null, 9001);