-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
44 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,17 @@ | |
namespace Carbon\Doctrine; | ||
|
||
use Carbon\CarbonImmutable; | ||
use DateTimeImmutable; | ||
use Doctrine\DBAL\Platforms\AbstractPlatform; | ||
use Doctrine\DBAL\Types\VarDateTimeImmutableType; | ||
|
||
class DateTimeImmutableType extends VarDateTimeImmutableType implements CarbonDoctrineType | ||
{ | ||
/** @use CarbonTypeConverter<CarbonImmutable> */ | ||
use CarbonTypeConverter; | ||
use CarbonTypeConverter | ||
{ | ||
convertToPHPValue as private baseConvertToPHPValue; | ||
} | ||
|
||
/** | ||
* @return class-string<CarbonImmutable> | ||
|
@@ -21,4 +26,14 @@ protected function getCarbonClassName(): string | |
{ | ||
return CarbonImmutable::class; | ||
} | ||
|
||
/** | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
* | ||
* @return T|null | ||
*/ | ||
public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?DateTimeImmutable | ||
Check failure on line 35 in src/Carbon/Doctrine/DateTimeImmutableType.php GitHub Actions / PHPStan (8.1)
Check failure on line 35 in src/Carbon/Doctrine/DateTimeImmutableType.php GitHub Actions / PHPStan (8.1)
|
||
{ | ||
return $this->baseConvertToPHPValue($value, $platform); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters