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

Psalm fails on release commits #4367

Closed
morozov opened this issue Oct 20, 2020 · 2 comments · Fixed by #4373
Closed

Psalm fails on release commits #4367

morozov opened this issue Oct 20, 2020 · 2 comments · Fixed by #4373

Comments

@morozov
Copy link
Member

morozov commented Oct 20, 2020

See https://github.com/doctrine/dbal/actions/runs/317884479

Also reproducible locally:

$ psalm
Scanning files...
Analyzing files...

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░  60 / 519 (11%)
░░░░░░░░░░░░░░░░░░░░░░░░E░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 120 / 519 (23%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 180 / 519 (34%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 240 / 519 (46%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 300 / 519 (57%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 360 / 519 (69%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 420 / 519 (80%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 480 / 519 (92%)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

ERROR: RedundantCondition - lib/Doctrine/DBAL/Version.php:31:48 - The call to strtolower is unnecessary (see https://psalm.dev/122)
        $currentVersion = str_replace(' ', '', strtolower(self::VERSION));


------------------------------
1 errors found
------------------------------
1951 other issues found.
You can display them with --show-info=true
------------------------------
Psalm can automatically fix 1 of these issues.
Run Psalm again with
--alter --issues=MissingParamType --dry-run
to see what it can fix.
------------------------------

Checks took 20.57 seconds and used 514.289MB of memory
Psalm was able to infer types for 96.7456% of the codebase
@morozov
Copy link
Member Author

morozov commented Oct 20, 2020

According to the documentation,

Special version strings such as alpha and beta are case sensitive. Version strings from arbitrary sources that do not adhere to the PHP standard may need to be lowercased via strtolower() before calling version_compare().

Therefore, the existing logic is correct with the exception of the release versions which don't contain any letters. In order to not complicate the release process, we can just suppress this error in 2.x.

@morozov morozov added this to the 2.12.0 milestone Oct 20, 2020
@morozov morozov linked a pull request Oct 20, 2020 that will close this issue
@morozov morozov closed this as completed Oct 21, 2020
@morozov morozov removed the Won't Fix label Sep 12, 2021
@morozov morozov modified the milestones: 2.12.0, 2.13.4 Sep 12, 2021
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant