Verified Commit 09daf7c4 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3309047 by mondrake: Fix 'should return {type} but return statement is...

Issue #3309047 by mondrake: Fix 'should return {type} but return statement is missing' PHPStan L0 errors in test code

(cherry picked from commit 13c8eaf3)
parent 46c00ce0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ interface DeriverInterface {
   *   is derived. It is maybe an entire object or just some array, depending
   *   on the discovery mechanism.
   *
   * @return array
   * @return array|null
   *   The full definition array of the derivative plugin, typically a merge of
   *   $base_plugin_definition with extra derivative-specific information. NULL
   *   if the derivative doesn't exist.
+3 −0
Original line number Diff line number Diff line
@@ -90,6 +90,8 @@ public function boot() {
    if (!is_dir('public://simpletest') && !@mkdir('public://simpletest', 0777, TRUE) && !is_dir('public://simpletest')) {
      throw new \RuntimeException('Unable to create directory: public://simpletest');
    }

    return $this;
  }

  /**
@@ -100,6 +102,7 @@ public function discoverServiceProviders() {
    // The test runner does not require an installed Drupal site to exist.
    // Therefore, its environment is identical to that of the early installer.
    $this->serviceProviderClasses['app']['Test'] = 'Drupal\Core\Installer\InstallerServiceProvider';
    return $this->serviceProviderClasses;
  }

}
+1 −0
Original line number Diff line number Diff line
@@ -146,6 +146,7 @@ public function save(array $form, FormStateInterface $form_state) {
    }

    $form_state->setRedirectUrl($this->entity->toUrl('collection'));
    return $status;
  }

  /**
+9 −3
Original line number Diff line number Diff line
@@ -16,16 +16,22 @@ class NoSourceModule extends DrupalSqlBase {
  /**
   * {@inheritdoc}
   */
  public function query() {}
  public function query() {
    throw new \BadMethodCallException('This method should never be called');
  }

  /**
   * {@inheritdoc}
   */
  public function fields() {}
  public function fields() {
    throw new \BadMethodCallException('This method should never be called');
  }

  /**
   * {@inheritdoc}
   */
  public function getIds() {}
  public function getIds() {
    throw new \BadMethodCallException('This method should never be called');
  }

}
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ public function setSearch($keywords, array $parameters, array $attributes) {
      $parameters['search_conditions'] = '';
    }
    parent::setSearch($keywords, $parameters, $attributes);
    return $this;
  }

  /**
Loading