Problem/Motivation

PHPStan baseline is currently skipping multiple Call to an undefined method errors.

Proposed resolution

Fix Updater errors, clean up the baseline.

CommentFileSizeAuthor
#5 3317652-5.patch1.36 KBmondrake
#2 3317652-2.patch1.8 KBmondrake

Comments

mondrake created an issue. See original summary.

mondrake’s picture

Status: Active » Needs review
StatusFileSize
new1.8 KB
longwave’s picture

+++ b/core/lib/Drupal/Core/Updater/Updater.php
@@ -194,6 +194,23 @@ public static function getProjectTitle($directory) {
+  public function getInstallDirectory() {
+    throw new \BadMethodCallException(get_class() . '::getInstallDirectory() not implemented.');

I am sure in this case this could just be abstract? Updaters are only used by core, there are only Module and Theme implementations, and I don't see a use case outside of that.

mondrake’s picture

Status: Needs review » Needs work

Thanks @longwave, NW

mondrake’s picture

Status: Needs work » Needs review
StatusFileSize
new1.36 KB
longwave’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, I think this is fine even if it's technically an API change - all this Updater code should be considered internal as far as I can see.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed d96c99b and pushed to 10.1.x. Thanks!
Committed 104a255 and pushed to 10.0.x. Thanks!

I debated whether we should have a CR for this but I don't think so. The only stuff I can find in contrib is from clones of core... see https://git.drupalcode.org/search?group_id=2&page=3&repository_ref=&scop...

I think we should file a follow-up for the abstract class to implement \Drupal\Core\Updater\UpdaterInterface and then fix the docs in the abstract to use @inheritdoc.

  • alexpott committed d96c99b on 10.1.x
    Issue #3317652 by mondrake, longwave: Fix Updater PHPStan L0 issues
    

  • alexpott committed 104a255 on 10.0.x
    Issue #3317652 by mondrake, longwave: Fix Updater PHPStan L0 issues
    
    (...
mondrake’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.