Commit 330cbd74 authored by catch's avatar catch
Browse files

Issue #3316276 by mondrake: Fix 'undefined variable' PHPStan L0 errors

(cherry picked from commit 2170e97e)
parent e3352f8e
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -53,10 +53,6 @@ public function preQuery() {
        continue;
      }

      if (isset($handler)) {
        unset($handler);
      }

      $handler = &$this->view->argument[$key];
      if (empty($handler->definition['accept depth modifier'])) {
        continue;
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ public function validateArgument($argument) {
      return FALSE;
    }

    if (!empty($this->argument->definition['numeric']) && !isset($this->argument->options['break_phrase']) && !is_numeric($arg)) {
    if (!empty($this->argument->definition['numeric']) && !isset($this->argument->options['break_phrase'])) {
      return FALSE;
    }

+2 −14
Original line number Diff line number Diff line
@@ -79,13 +79,7 @@ public function query() {
      $first['extra'] = $this->definition['join_extra'];
    }

    if (!empty($def['join_id'])) {
      $id = $def['join_id'];
    }
    else {
      $id = 'standard';
    }
    $first_join = $this->joinManager->createInstance($id, $first);
    $first_join = $this->joinManager->createInstance('standard', $first);

    $this->first_alias = $this->query->addTable($this->definition['field table'], $this->relationship, $first_join);

@@ -103,13 +97,7 @@ public function query() {
      $second['type'] = 'INNER';
    }

    if (!empty($def['join_id'])) {
      $id = $def['join_id'];
    }
    else {
      $id = 'standard';
    }
    $second_join = $this->joinManager->createInstance($id, $second);
    $second_join = $this->joinManager->createInstance('standard', $second);
    $second_join->adjusted = TRUE;

    // use a short alias for this:
+0 −15
Original line number Diff line number Diff line
@@ -1155,11 +1155,6 @@ parameters:
			count: 1
			path: modules/taxonomy/src/Plugin/migrate/source/d7/TermTranslation.php

		-
			message: "#^Call to function unset\\(\\) contains undefined variable \\$handler\\.$#"
			count: 1
			path: modules/taxonomy/src/Plugin/views/argument/IndexTidDepthModifier.php

		-
			message: "#^Method Drupal\\\\taxonomy\\\\TermForm\\:\\:save\\(\\) should return int but return statement is missing\\.$#"
			count: 1
@@ -1315,11 +1310,6 @@ parameters:
			count: 1
			path: modules/views/src/Plugin/views/argument/Date.php

		-
			message: "#^Undefined variable\\: \\$arg$#"
			count: 1
			path: modules/views/src/Plugin/views/argument_validator/None.php

		-
			message: "#^Method Drupal\\\\views\\\\Plugin\\\\views\\\\cache\\\\CachePluginBase\\:\\:cacheGet\\(\\) should return bool but return statement is missing\\.$#"
			count: 1
@@ -1365,11 +1355,6 @@ parameters:
			count: 2
			path: modules/views/src/Plugin/views/filter/FilterPluginBase.php

		-
			message: "#^Undefined variable\\: \\$def$#"
			count: 2
			path: modules/views/src/Plugin/views/relationship/EntityReverse.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: 1