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

Upgrade to PHPStan 2.x #6855

Merged
merged 1 commit into from
Mar 10, 2025
Merged

Conversation

javiereguiluz
Copy link
Collaborator

@javiereguiluz javiereguiluz commented Mar 6, 2025

There are two issues that I can't fix, even with AI help:

https://github.com/EasyCorp/EasyAdminBundle/blob/4.x/src/Dto/EntityDto.php#L170-L171

 ------ ------------------------------------------------------------------------------------------------------------------------------------
  Line   Dto/EntityDto.php
 ------ ------------------------------------------------------------------------------------------------------------------------------------
  175    PHPDoc tag @var with type array|Doctrine\ORM\Mapping\FieldMapping is not subtype of native type Doctrine\ORM\Mapping\FieldMapping.
         🪪  varTag.nativeType
 ------ ------------------------------------------------------------------------------------------------------------------------------------

/** @var string|false $formattedCurrency */
$formattedCurrency = $formatter->formatCurrency($amount, $currency);

 ------ -----------------------------------------------------------------------
  Line   Intl/IntlFormatter.php
 ------ -----------------------------------------------------------------------
  112    PHPDoc tag @var with type string|false is not subtype of type string.
         🪪  varTag.type
 ------ -----------------------------------------------------------------------

@javiereguiluz javiereguiluz added this to the 4.x milestone Mar 6, 2025
@JorickPepin
Copy link
Contributor

Hello @javiereguiluz.

For the second case, I think you can simply remove the @var annotation as the false case is handled by the if just below.

For the first one, it seems to be related to the fact that with Doctrine ORM 3.x, $fieldMapping can only be of type FieldMapping but I don't know how to fix that.

@javiereguiluz javiereguiluz merged commit 68cdc0d into EasyCorp:4.x Mar 10, 2025
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