From d96c99b491bf0ae2aad0b4027dc70935e6428be9 Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Thu, 3 Nov 2022 00:23:39 +0000 Subject: [PATCH] Issue #3317652 by mondrake, longwave: Fix Updater PHPStan L0 issues --- core/lib/Drupal/Core/Updater/Updater.php | 10 +++++++++- core/phpstan-baseline.neon | 5 ----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/core/lib/Drupal/Core/Updater/Updater.php b/core/lib/Drupal/Core/Updater/Updater.php index 402047fc9845..f20dd67e8c2e 100644 --- a/core/lib/Drupal/Core/Updater/Updater.php +++ b/core/lib/Drupal/Core/Updater/Updater.php @@ -8,7 +8,7 @@ /** * Defines the base class for Updaters used in Drupal. */ -class Updater { +abstract class Updater { /** * Directory to install from. @@ -194,6 +194,14 @@ public static function getProjectTitle($directory) { return $info['name']; } + /** + * Returns the path to the default install location for the current project. + * + * @return string + * The absolute path of the directory. + */ + abstract public function getInstallDirectory(); + /** * Stores the default parameters for the Updater. * diff --git a/core/phpstan-baseline.neon b/core/phpstan-baseline.neon index 89c13f6a8d83..7ae594d85105 100644 --- a/core/phpstan-baseline.neon +++ b/core/phpstan-baseline.neon @@ -385,11 +385,6 @@ parameters: count: 1 path: lib/Drupal/Core/Updater/Module.php - - - message: "#^Call to an undefined method Drupal\\\\Core\\\\Updater\\\\Updater\\:\\:getInstallDirectory\\(\\)\\.$#" - count: 1 - path: lib/Drupal/Core/Updater/Updater.php - - message: "#^Method Drupal\\\\action\\\\Form\\\\ActionFormBase\\:\\:save\\(\\) should return int but return statement is missing\\.$#" count: 1 -- GitLab