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

Add vimeo/psalm #76

Merged
merged 9 commits into from Jan 7, 2021
Merged

Conversation

lukaslangen
Copy link
Contributor

Solves issue #73

  • Create a .psalm.xml.dist in the project root
  • Copy and paste the contents from this psalm.xml.dist
  • Run $ composer require vimeo/psalm
  • Run $ vendor/bin/psalm --set-baseline=psalm-baseline.xml
  • Add a composer script static-analysis with the command psalm --shepherd --stats
  • Add a new line to script: in .travis.yml: - if [[ $TEST_COVERAGE == 'true' ]]; then composer static-analysis ; fi
  • (obsolete, because no phpstan configuration was given) Remove phpstan from the project (phpstan.neon.dist, .travis.yml entry, composer.json require-dev and scripts)

@lukaslangen lukaslangen force-pushed the psalm-integration branch 2 times, most recently from 9af5ba1 to a09648b Compare October 5, 2020 22:47
@boesing boesing added Enhancement hacktoberfest-accepted Issues/Pull-Requests which can be fixed during Hacktoberfest: https://hacktoberfest.digitalocean.com labels Oct 6, 2020
@boesing boesing added this to To do in Psalm via automation Oct 6, 2020
@boesing boesing linked an issue Oct 6, 2020 that may be closed by this pull request
8 tasks
@boesing
Copy link
Member

boesing commented Nov 17, 2020

@lukaslangen Thanks for this PR.

To make travis pass, you can either temporarily add COMPOSER_ROOT_VERSION=2.14.0 to travis.yml or "version": "2.14.0" to composer.json in a single commit.
After this, travis should startup and execute tests.
When anything is green, we can add this to the next release 👍

@weierophinney weierophinney added this to the 2.14.0 milestone Jan 6, 2021
Lukas Langen and others added 2 commits January 6, 2021 16:59
Added configuration in .travis.yml and composer.json
Added psalm-baseline.xml

Signed-off-by: Lukas Langen <lukas@langen.dev>
Signed-off-by: Lukas Langen <lukas@langen.dev>
Due to issues running on 7.4

Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
@weierophinney
Copy link
Member

@lukaslangen Thank you!

I've rebased and pushed back to your branch. Since the 2.14.x series has a number of other changes, I'm resetting the baseline, and correcting a number of the autogenerated @psalm-return annotations on data providers; once those are done, I'll push back here, and it should be ready to merge.

Thanks for getting this started!

- Updates to Psalm 4.3 series and psalm/plugin-phpunit 0.15 series, to correct issues when defining array/iterable annotations.
- Applies autofixes.
- Adds appropriate `@psalm-return` annotations for unit test data providers.

Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
src/Barcode.php Outdated
*/
public function getChecksum()
public function getChecksum(): bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thos change seems wrong 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, ran across another in the Bitwise validator. The original patch was on an older version of Psalm, so when I did my autofixes, it wasn't taking into account BC rules (which the v4 series does). Doing an audit of signatures now.

Psalm added `: int`, which (a) breaks BC, and (b) is incorrect, as it can sometimes return a null.

Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
Since I did autocorrections originally with an older version of Psalm, it did not take into account backwards compatibility, and introduced a number of BC breaks.
This patch corrects them.

Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
Use camelCase, not TitleCase.

Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
One more error that was invalid to add to the initial package baseline

Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
@weierophinney weierophinney merged commit 9e21d1c into laminas:2.14.x Jan 7, 2021
Psalm automation moved this from To do to Done Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement hacktoberfest-accepted Issues/Pull-Requests which can be fixed during Hacktoberfest: https://hacktoberfest.digitalocean.com
Projects
No open projects
Psalm
  
Done
Development

Successfully merging this pull request may close these issues.

Psalm integration
4 participants