- Issue created by @tedbow
- @tedbow opened merge request.
- Status changed to Needs work
almost 2 years ago 7:12pm 15 February 2023 - 🇺🇸United States tedbow Ithaca, NY, USA
I started the
3342120-fix-some-phpstan
because are some clear things we can fix. If someone wants to take this up there are more to fix - Assigned to yash.rode
- Assigned to wim leers
- Status changed to Needs review
over 1 year ago 1:40pm 20 February 2023 - 🇮🇳India yash.rode pune
Do I need to fix all of this problems + every other problem in package_manager (phpstan has problme with every use of \Drupal) I am getting on local? Also I need help with
package_manager/tests/src/Kernel/SymlinkValidatorTest.php
problem that$this->reveal() Call to an undefined method Drupal\Tests\package_manager\Kernel\SymlinkValidatorTest::reveal().
- Assigned to yash.rode
- Status changed to Active
over 1 year ago 2:13pm 20 February 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Yes, we should fix everything.
(I'm assuming you get the same output locally as @tedbow reported above?)
- Status changed to Needs work
over 1 year ago 9:03am 21 February 2023 - 🇮🇳India yash.rode pune
Hi @tedbow, I am not able to reproduce
auto_updates/src/Validator/StagedProjectsValidator.php
locallysee:
Am I missing something? Other than that other errors are fixed taking consideration
core/phpstan.neon.dist
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Hi @tedbow, I am not able to reproduce
auto_updates/src/Validator/StagedProjectsValidator.php
locallysee:
Am I missing something? Other than that other errors are fixed taking consideration
core/phpstan.neon.dist
You are missing something. You continued Ted's MR. Ted had already fixed this in his first commit to the MR: https://git.drupalcode.org/project/automatic_updates/-/merge_requests/70... …
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Clarifying after discussing with @tedbow and @yash.rode :)
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
See #3343430-4: Commit our copied and edited version of commit-code-check.sh → , I am pretty sure that Drupal core was not running these checks anymore either!
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
This has been unblocked since 📌 Stop reusing core's commit-code-check.sh in favor of 4 simple commands Fixed landed last night!
- 🇮🇳India yash.rode pune
phpstan.neon.dist
excludes error pattern#^Class .* extends @internal class#
but we are getting an error messagesAnonymous class extends @internal class Drupal\automatic_updates\Validator\CronFrequencyValidator
- Assigned to wim leers
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
As discussed in the call just now, I'll be digging into this — you fixed all the things, the only remaining thing is battling
phpstan
👍🤓 - Status changed to Needs review
over 1 year ago 12:25pm 23 February 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
🥳
PHPStan
is passing now!But … a million tests are failing.
Because this was added
assert($this instanceof ContainerBuilder);
to
\Drupal\Tests\package_manager\Traits\ValidationTestTrait::resolvePlaceholdersInArrayValuesWithRealPaths()
.That of course makes no sense. But specifying
$this->container
just triggers another PHPStan error.Fixed.
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
There was a similar bug introduced by @yash.rode in
FormTestTrait
. Fixed that too. Now doing a proper review… - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
I reverted 99% of @yash.rode's
1a4a9768be59ccb95d8d48c15e791e4589b9ea28
. See https://git.drupalcode.org/project/automatic_updates/-/merge_requests/70.... - Issue was unassigned.
- Status changed to RTBC
over 1 year ago 1:21pm 23 February 2023 - Status changed to Needs review
over 1 year ago 3:06pm 23 February 2023 - Status changed to RTBC
over 1 year ago 3:30pm 23 February 2023 - Assigned to phenaproxima
- Status changed to Needs work
over 1 year ago 3:43pm 23 February 2023 - 🇺🇸United States phenaproxima Massachusetts
Assigning to myself to fix the one outstanding thing that I don't agree with.
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
🥳 Thanks!
Will be great to finally have
phpstan
running again, and this time we'll know for sure we won't regress! 😊 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Based on the sheer number of tests that will have to become more complicated … do you really think 4d58dd79 is worth it, @phenaproxima? That seems like a pretty painful change for DX… 😳
- Status changed to RTBC
over 1 year ago 6:51pm 23 February 2023 - 🇺🇸United States phenaproxima Massachusetts
Re #26: I concur. I'd still like to not redefine the property unless we absolutely have to. And if we absolutely have to, then it will need a comment to explain it.
That said, it looks like asserting that $this is a KernelTestBase or BrowserTestBase (both of which have $this->container) was sufficient. Restoring RTBC and will merge when tests pass.
-
phenaproxima →
committed b1d74476 on 3.0.x authored by
tedbow →
Issue #3342120 by Wim Leers, yash.rode, tedbow, phenaproxima: Fix...
-
phenaproxima →
committed b1d74476 on 3.0.x authored by
tedbow →
- Status changed to Fixed
over 1 year ago 7:04pm 23 February 2023 - 🇺🇸United States phenaproxima Massachusetts
Nice to get this merged in. I think PHPStan will catch a lot of little logic errors and nitpicks that we'd usually find in code review. Hopefully this makes development a little easier and keeps us closer to core standards!
- Issue was unassigned.
Automatically closed - issue fixed for 2 weeks with no activity.