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

[master] PHPStan integration - levels 0 + 1 #6535

Merged
merged 2 commits into from
Jul 7, 2017

Conversation

Majkl578
Copy link
Contributor

Based on #6440, rebased & moved from composer.json to .travis.yml (to be installed only during CI builds). Fixed lib/ for levels 0 & 1.

I don't like the changes for level 1 though. Some of the changes shouldn't be even needed - PHPStan limitation reported in phpstan/phpstan#349.

@Majkl578
Copy link
Contributor Author

Majkl578 commented Jun 29, 2017

Wow, removal of the return from PersistentCollection#offsetSet() breaks 26 tests... Well, that is..., unexpected... at least. :) Fixed - one return must stay of course.

@Majkl578 Majkl578 force-pushed the phpstan branch 2 times, most recently from 658bb63 to afe5e36 Compare June 29, 2017 22:17
@Ocramius
Copy link
Member

The scrutinizer changes are unrelated, so this is good to go.

- if [[ $DB == "mysql" || $DB == "mariadb" ]]; then mysql -e "CREATE SCHEMA doctrine_tests; GRANT ALL PRIVILEGES ON doctrine_tests.* to travis@'%'"; fi;

script:
- if [[ $PHPSTAN = 1 ]]; then vendor/bin/phpstan analyse -l 1 -c phpstan.neon lib; fi
Copy link
Member

Choose a reason for hiding this comment

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

Can we eventually also analyse the tests dir?

@Majkl578
Copy link
Contributor Author

@Ocramius Ok, I'll see what could be done there, it won't work out-of-box though...

$ vendor/bin/phpstan analyse -l 1 -c phpstan.neon tests/
  19/835 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   2%PHP Fatal error:  Class 'Doctrine\Common\Cli\Tasks\AbstractTask' not found in /www/doctrine/doctrine2/tests/Doctrine/Tests/Mocks/TaskMock.php on line 12

@Majkl578
Copy link
Contributor Author

Majkl578 commented Jun 30, 2017

Damn, the tests are in a really bad shape, it'll be massive donkey work to improve them and fix them to get to level 1 (or 0 at least). It's over 150 issues already for level 0, over 300 for level 1.
Fixed some of them, but manywill require more than just simply fixing a type (i.e. dependencies between test files, undefined ::class references etc.). 😞

@Ocramius
Copy link
Member

@Majkl578 then let's skip it for now.

@Majkl578
Copy link
Contributor Author

Majkl578 commented Jul 6, 2017

@Ocramius Can we merge this then? Or anything else?

@lcobucci lcobucci merged commit c32ba8f into doctrine:master Jul 7, 2017
@lcobucci
Copy link
Member

lcobucci commented Jul 7, 2017

@Majkl578 🚢 thanks!

@Majkl578 Majkl578 deleted the phpstan branch July 25, 2017 20:29
@Majkl578 Majkl578 added this to the 2.6.0 milestone Dec 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants