Verified Commit ab042574 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3259109 by mondrake, longwave, andregp, daffie, mglaman, neclimdul,...

Issue #3259109 by mondrake, longwave, andregp, daffie, mglaman, neclimdul, alexpott: Fix 'Cannot unset offset' PHPStan L0 errors

(cherry picked from commit 74b0acbe)
parent 1c9b2a6d
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -396,7 +396,6 @@ public function providerGetUpgradeStates() {
    // Test menu migration with menu_ui uninstalled.
    $tests[3] = $tests[1];
    unset($tests[3]['modules_to_enable']['menu_ui']);
    unset($tests[3]['files']['menu_ui']);
    unset($tests[3]['migrations']['menu_ui']);
    $tests[3]['expected_7'] = [
      MigrationState::NOT_FINISHED => [
+0 −1
Original line number Diff line number Diff line
@@ -449,7 +449,6 @@ public function defaultableSections($section = NULL) {
    // If the display cannot use a pager, then we cannot default it.
    if (!$this->usesPager()) {
      unset($sections['pager']);
      unset($sections['items_per_page']);
    }

    foreach ($this->extenders as $extender) {
+0 −35
Original line number Diff line number Diff line
@@ -895,11 +895,6 @@ parameters:
			count: 1
			path: modules/migrate/tests/src/Kernel/MigrateTestBase.php

		-
			message: "#^Cannot unset offset 'menu_ui' on array\\{system\\: \"finished\\:\\\\n  6\\:\\\\n   …\", menu_link_content\\: \"finished\\:\\\\n  6\\:\\\\n   …\", menu\\: \"finished\\:\\\\n  6\\:\\\\n   …\"\\}\\.$#"
			count: 1
			path: modules/migrate_drupal/tests/src/Unit/MigrationStateUnitTest.php

		-
			message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:10\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
			count: 2
@@ -1415,11 +1410,6 @@ parameters:
			count: 1
			path: modules/views/src/Plugin/views/cache/Time.php

		-
			message: "#^Cannot unset offset 'items_per_page' on array\\{access\\: array\\{'access'\\}, cache\\: array\\{'cache'\\}, title\\: array\\{'title'\\}, css_class\\: array\\{'css_class'\\}, use_ajax\\: array\\{'use_ajax'\\}, hide_attachment_summary\\: array\\{'hide_attachment…'\\}, show_admin_links\\: array\\{'show_admin_links'\\}, group_by\\: array\\{'group_by'\\}, \\.\\.\\.\\}\\.$#"
			count: 1
			path: modules/views/src/Plugin/views/display/DisplayPluginBase.php

		-
			message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:10\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
			count: 2
@@ -1715,21 +1705,6 @@ parameters:
			count: 1
			path: tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php

		-
			message: "#^Cannot unset offset int on array\\<string, mixed\\>\\.$#"
			count: 1
			path: tests/Drupal/Tests/Component/PhpStorage/FileStorageReadOnlyTest.php

		-
			message: "#^Cannot unset offset int on array\\<string, mixed\\>\\.$#"
			count: 1
			path: tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php

		-
			message: "#^Cannot unset offset int on array\\<string, mixed\\>\\.$#"
			count: 1
			path: tests/Drupal/Tests/Component/PhpStorage/PhpStorageTestBase.php

		-
			message: "#^Result of static method Drupal\\\\Composer\\\\Composer\\:\\:ensureComposerVersion\\(\\) \\(void\\) is used\\.$#"
			count: 1
@@ -1755,11 +1730,6 @@ parameters:
			count: 1
			path: tests/Drupal/Tests/Core/Entity/EntityTypeBundleInfoTest.php

		-
			message: "#^Cannot unset offset 'data\\-drupal\\-link…' on array\\{data\\-drupal\\-link\\-system\\-path\\: '\\<front\\>'\\}\\.$#"
			count: 2
			path: tests/Drupal/Tests/Core/EventSubscriber/ActiveLinkResponseFilterTest.php

		-
			message: "#^Call to method getDefinitions\\(\\) on an unknown class Drupal\\\\Core\\\\Plugin\\\\CategorizingPluginManagerTrait\\.$#"
			count: 3
@@ -1790,11 +1760,6 @@ parameters:
			count: 1
			path: tests/Drupal/Tests/Core/Render/RendererCallbackTest.php

		-
			message: "#^Cannot unset offset '\\#cache' on array\\{\\#lazy_builder\\: array\\{'Drupal\\\\\\\\Tests\\\\\\\\Core…', array\\{mixed\\}\\}\\}\\.$#"
			count: 1
			path: tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php

		-
			message: "#^Call to an undefined method Drupal\\\\Tests\\\\Core\\\\Test\\\\TestClass\\:\\:assertArrayHasKey\\(\\)\\.$#"
			count: 3
+2 −2
Original line number Diff line number Diff line
@@ -57,11 +57,11 @@ public function testReadOnly() {

    // Find a global that doesn't exist.
    do {
      $random = mt_rand(10000, 100000);
      $random = 'test' . mt_rand(10000, 100000);
    } while (isset($GLOBALS[$random]));

    // Write out a PHP file and ensure it's successfully loaded.
    $code = "<?php\n\$GLOBALS[$random] = TRUE;";
    $code = "<?php\n\$GLOBALS['$random'] = TRUE;";
    $success = $php->save($name, $code);
    $this->assertTrue($success);
    $php_read = new FileReadOnlyStorage($this->readonlyStorage);
+2 −2
Original line number Diff line number Diff line
@@ -70,11 +70,11 @@ public function testDeleteAll() {

    // Find a global that doesn't exist.
    do {
      $random = mt_rand(10000, 100000);
      $random = 'test' . mt_rand(10000, 100000);
    } while (isset($GLOBALS[$random]));

    // Write out a PHP file and ensure it's successfully loaded.
    $code = "<?php\n\$GLOBALS[$random] = TRUE;";
    $code = "<?php\n\$GLOBALS['$random'] = TRUE;";
    $this->assertTrue($php->save($name, $code), 'Saved php file');
    $php->load($name);
    $this->assertTrue($GLOBALS[$random], 'File saved correctly with correct value');
Loading