Verified Commit 59f14c20 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 0bab40ee)
parent f17bf6c5
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
@@ -439,7 +439,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) {
+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');
+2 −2
Original line number Diff line number Diff line
@@ -39,11 +39,11 @@ public function assertCRUD($php) {

    // 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, 'Saved php file');
    $php->load($name);
Loading