diff --git a/core/lib/Drupal/Core/Theme/ThemeManagerInterface.php b/core/lib/Drupal/Core/Theme/ThemeManagerInterface.php index 84eb7a2e30b89e46de7dae8baa2ac69535dc6fe5..61fa161e83ec1f28e953c6d85c71f09dd8e57d32 100644 --- a/core/lib/Drupal/Core/Theme/ThemeManagerInterface.php +++ b/core/lib/Drupal/Core/Theme/ThemeManagerInterface.php @@ -18,8 +18,9 @@ interface ThemeManagerInterface { * See the @link themeable Default theme implementations topic @endlink for * details. * - * @param string $hook - * The name of the theme hook to call. + * @param string|string[] $hook + * The name of the theme hook to call or an array of names of theme hooks to + * call. * @param array $variables * An associative array of theme variables. * diff --git a/core/lib/Drupal/Core/Utility/PhpRequirements.php b/core/lib/Drupal/Core/Utility/PhpRequirements.php index 2414c582d800637d57362f258ece1e6ff881ed0b..6538c3a009da1b957b5aeff3842569dec56aef3b 100644 --- a/core/lib/Drupal/Core/Utility/PhpRequirements.php +++ b/core/lib/Drupal/Core/Utility/PhpRequirements.php @@ -80,7 +80,7 @@ public static function getMinimumSupportedPhp(?\DateTime $date = NULL): string { // The string cast ensures the value is a string, even if the PHP EOL date // array is empty. As of PHP 8.1, version_compare() no longer accepts NULL // as a parameter; empty string must be used instead. - $lowest_supported_version = $lowest_supported_version ?? (string) array_key_last(static::$phpEolDates); + $lowest_supported_version = (string) array_key_last(static::$phpEolDates); // Next, look at versions that are end-of-life after the current date. // Find the lowest PHP version that is still supported. diff --git a/core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockSettingsTest.php b/core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockSettingsTest.php index 47e3128eb98a63bf79e0cddda9af405610c696ff..d73489337f3b0810e5da03714260946d5ff2d9a8 100644 --- a/core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockSettingsTest.php +++ b/core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockSettingsTest.php @@ -28,9 +28,7 @@ class BlockSettingsTest extends UnitTestCase { public function testTransform($value, $expected) { $executable = $this->prophesize(MigrateExecutableInterface::class) ->reveal(); - if (empty($row)) { - $row = $this->prophesize(Row::class)->reveal(); - } + $row = $this->prophesize(Row::class)->reveal(); $plugin = new BlockSettings([], 'block_settings', []); $actual = $plugin->transform($value, $executable, $row, 'foo'); diff --git a/core/modules/locale/src/LocaleProjectStorage.php b/core/modules/locale/src/LocaleProjectStorage.php index 8147b4c0eb4cb022acdcef2ce5b234c9f57ef50b..8d34d0887b698d0fc893f6557f663eb68b4bc289 100644 --- a/core/modules/locale/src/LocaleProjectStorage.php +++ b/core/modules/locale/src/LocaleProjectStorage.php @@ -140,8 +140,8 @@ public function disableAll() { $projects = $this->keyValueStore->getAll(); foreach (array_keys($projects) as $key) { $projects[$key]['status'] = 0; - if (isset($cache[$key])) { - $cache[$key] = $projects[$key]; + if (isset($this->cache[$key])) { + $this->cache[$key] = $projects[$key]; } } $this->keyValueStore->setMultiple($projects); diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 0e2fa13b4fb83f236089aa1542ee2bd99edf18fd..02694ea5fe216b88213f48f27ca5af76efebe17b 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -1144,7 +1144,7 @@ function node_access_rebuild($batch_mode = FALSE) { $access_control_handler->writeDefaultGrant(); } - if (!isset($batch)) { + if (!isset($batch_builder)) { \Drupal::messenger()->addStatus(t('Content permissions have been rebuilt.')); node_access_needs_rebuild(FALSE); } diff --git a/core/modules/views/src/Form/ViewsExposedForm.php b/core/modules/views/src/Form/ViewsExposedForm.php index bd6a9edd93cf7be31cbab5dc672a39b9df4ce4cc..14ff6d42dd5fe372a7ddb30f05fe663c156d7025 100644 --- a/core/modules/views/src/Form/ViewsExposedForm.php +++ b/core/modules/views/src/Form/ViewsExposedForm.php @@ -68,7 +68,7 @@ public function getFormId() { */ public function buildForm(array $form, FormStateInterface $form_state) { // Don't show the form when batch operations are in progress. - if ($batch = batch_get() && isset($batch['current_set'])) { + if (($batch = batch_get()) && isset($batch['current_set'])) { return [ // Set the theme callback to be nothing to avoid errors in template_preprocess_views_exposed_form(). '#theme' => '', diff --git a/core/phpstan-baseline.neon b/core/phpstan-baseline.neon index 8dfb361cf6deee498dca26945b3ada46b7c59c9c..f0059260781cf0e02a12368b7fd7ca2ed8d58bd4 100644 --- a/core/phpstan-baseline.neon +++ b/core/phpstan-baseline.neon @@ -859,11 +859,6 @@ parameters: count: 1 path: lib/Drupal/Core/Theme/ThemeInitialization.php - - - message: "#^Variable \\$candidate in isset\\(\\) is never defined\\.$#" - count: 1 - path: lib/Drupal/Core/Theme/ThemeManager.php - - message: "#^Variable \\$candidate might not be defined\\.$#" count: 1 @@ -899,11 +894,6 @@ parameters: count: 1 path: lib/Drupal/Core/Updater/Module.php - - - message: "#^Variable \\$lowest_supported_version on left side of \\?\\? is never defined\\.$#" - count: 1 - path: lib/Drupal/Core/Utility/PhpRequirements.php - - message: "#^Method Drupal\\\\action\\\\Form\\\\ActionFormBase\\:\\:save\\(\\) should return int but return statement is missing\\.$#" count: 1 @@ -919,11 +909,6 @@ parameters: count: 1 path: modules/block/tests/src/Functional/BlockUiTest.php - - - message: "#^Variable \\$row in empty\\(\\) is never defined\\.$#" - count: 1 - path: modules/block/tests/src/Unit/Plugin/migrate/process/BlockSettingsTest.php - - message: "#^Variable \\$dependency in empty\\(\\) always exists and is not falsy\\.$#" count: 1 @@ -1529,11 +1514,6 @@ parameters: count: 1 path: modules/locale/src/LocaleProjectStorage.php - - - message: "#^Variable \\$cache in isset\\(\\) is never defined\\.$#" - count: 1 - path: modules/locale/src/LocaleProjectStorage.php - - message: "#^Method Drupal\\\\locale\\\\PoDatabaseReader\\:\\:readItem\\(\\) should return Drupal\\\\Component\\\\Gettext\\\\PoItem but return statement is missing\\.$#" count: 1 @@ -1802,11 +1782,6 @@ parameters: count: 1 path: modules/mysql/tests/src/Kernel/mysql/SchemaTest.php - - - message: "#^Variable \\$batch in isset\\(\\) is never defined\\.$#" - count: 1 - path: modules/node/node.module - - message: "#^Method Drupal\\\\node\\\\ConfigTranslation\\\\NodeTypeMapper\\:\\:setEntity\\(\\) should return bool but return statement is missing\\.$#" count: 1 @@ -2365,11 +2340,6 @@ parameters: count: 1 path: modules/user/tests/src/Unit/UserAccessControlHandlerTest.php - - - message: "#^Variable \\$batch in isset\\(\\) is never defined\\.$#" - count: 1 - path: modules/views/src/Form/ViewsExposedForm.php - - message: "#^Method Drupal\\\\views\\\\Form\\\\ViewsFormMainForm\\:\\:getFormId\\(\\) should return string but return statement is missing\\.$#" count: 1