Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PHPUnit 10 compatibility #2830

Closed
wants to merge 1 commit into from
Closed

Conversation

rgson
Copy link
Contributor

@rgson rgson commented Aug 4, 2023

  • Adds type hints to tests to deal with errors like:

.PHP Fatal error: Declaration of Carbon\Doctrine\CarbonTypeConverter::getSQLDeclaration(array $fieldDeclaration, Doctrine\DBAL\Platforms\AbstractPlatform $platform) must be compatible with Doctrine\DBAL\Types\DateTimeType::getSQLDeclaration(array $column, Doctrine\DBAL\Platforms\AbstractPlatform $platform): string in src/Carbon/Doctrine/CarbonTypeConverter.php on line 37

  • Adds a workaround for a type mismatch in a trait shared between two classes in need of different return type signatures.

.PHP Fatal error: Declaration of Carbon\Doctrine\CarbonTypeConverter::convertToPHPValue(mixed $value, Doctrine\DBAL\Platforms\AbstractPlatform $platform): ?DateTimeInterface must be compatible with Doctrine\DBAL\Types\VarDateTimeImmutableType::convertToPHPValue(mixed $value, Doctrine\DBAL\Platforms\AbstractPlatform $platform): ?DateTimeImmutable in src/Carbon/Doctrine/CarbonTypeConverter.php on line 69

  • Replaces the removed assertObjectHasAttribute method.

@kylekatarnls
Copy link
Collaborator

This would drop completely the PHP 7 compatibility. But 3.x version is compatible with PHPUnit 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants