Verified Commit 6eaf9fa3 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."
parent 291d8a2f
Loading
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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.
   *
+1 −1
Original line number Diff line number Diff line
@@ -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.
+1 −3
Original line number Diff line number Diff line
@@ -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');
+2 −2
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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);
  }
Loading