Skip to content
Snippets Groups Projects
Verified Commit 66ddcd2a authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3391530 by Spokje, alexpott: Fix PHPStan L1 error "Variable $foo in/on...

Issue #3391530 by Spokje, alexpott: Fix PHPStan L1 error "Variable $foo in/on something() is never defined."

(cherry picked from commit 6eaf9fa3)
parent e1cdbcf9
No related branches found
No related tags found
21 merge requests!8376Drupal views: adding more granularity to the ‘use ajax’ functionality,!8300Issue #3443586 View area displays even when parent view has no results.,!7567Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7565Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7509Change label "Block description" to "Block type",!7344Issue #3292350 by O'Briat, KlemenDEV, hswong3i, smustgrave, quietone: Update...,!6922Issue #3412959 by quietone, smustgrave, longwave: Fix 12 'un' words,!6848Issue #3417553 by longwave: Remove withConsecutive() in CacheCollectorTest,!6720Revert "Issue #3358581 by pfrenssen, _tarik_, a.dmitriiev, smustgrave:...,!6560Update ClaroPreRender.php, confirming classes provided are in array format,!6528Issue #3414261 by catch: Add authenticated user umami performance tests,!6501Issue #3263668 by omkar-pd, Wim Leers, hooroomoo: Re-enable inline form errors...,!6354Draft: Issue #3380392 by phma: Updating language weight from the overview reverts label if translated,!6324Issue #3416723 by Ludo.R: Provide a "node type" views default argument,!6119Issue #3405704 by Spokje, longwave: symfony/psr-http-message-bridge major version bump,!5950Issue #3403653 by alexpott, longwave: Incorporate improvements to how contrib runs PHPStan to core,!5858Issue #3401971 by fjgarlin: Test-only job shouldn't require constant rebases...,!5716Draft: Issue #3401102 by Spokje, longwave, smustgrave: Nightwatch artifacts on GitLab not retained,!5674Transaction autocommit during shutdown relies on unreliable object destruction order,!5644Issue #3395563 by nireneko, marvil07, lauriii, borisson_, smustgrave, Wim...,!5041SDC ComponentElement: Transform slots scalar values to #plain_text instead of throwing an exception
Pipeline #31836 canceled
......@@ -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.
*
......
......@@ -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.
......
......@@ -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();
}
$plugin = new BlockSettings([], 'block_settings', []);
$actual = $plugin->transform($value, $executable, $row, 'foo');
......
......@@ -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);
......
......@@ -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);
}
......
......@@ -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' => '',
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment