Problem/Motivation
Amongst the "new" errors found when running PHPStan on level 2 is: Property Foo::$bar has unknown class Baz as its type.
This child-issue exists to fix all of those.
Steps to reproduce
- Run PHPStan on level 2 and see the above error amongst all others.
Proposed resolution
- Solve all of the the above mentioned reported errors.
- Run PHPStan on level 2 and don't see the above mentioned error any more.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | level2_POST-3324801.txt | 2.12 MB | spokje |
| #3 | level2_PRE.txt | 2.18 MB | spokje |
Issue fork drupal-3324801
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3324801-fix-phpstan-l2
changes, plain diff MR !3053
Comments
Comment #3
spokjeAttached out of
vendor/bin/phpstan analyze --configuration=core/phpstan.neon.dist --xdebug --no-ansiwith lvl 2 before and after applying the MR.Comment #4
spokjeLet's not mess with copied Doctrine code for now.
Comment #5
spokjeHmm, that looks like a known random JS test failure.
Putting this on NR and ordering retest.
Comment #6
mondrakeNice cleanup. Just one quirk, then it's RTBC for me.
Comment #7
mondrakeUsual random javascrpti test failure? Retesting and RTBCing. Only PHPDoc changes.
Comment #9
longwaveCommitted to 10.1.x and backported to 10.0.x and 9.5.x to keep API docs in sync.
Committed and pushed 85eeb1bde1 to 10.1.x and 18e211cc79 to 10.0.x and d2cc35b992 to 9.5.x. Thanks!
Comment #13
tr commentedAt least one of the changes in this patch is wrong:
This should be
LanguageInterface|nulland not justLanguage.I opened an issue for this problem with the "language" datatype definition a year ago in #3264592: Core 'language' datatype has wrong @var types.
I would appreciate some eyes on that because the commit here did not fix the problem and just made more work for me.