diff --git a/modules/search_api_db/src/Plugin/search_api/backend/Database.php b/modules/search_api_db/src/Plugin/search_api/backend/Database.php
index 84cef229..28b3f8a5 100644
--- a/modules/search_api_db/src/Plugin/search_api/backend/Database.php
+++ b/modules/search_api_db/src/Plugin/search_api/backend/Database.php
@@ -713,7 +713,7 @@ protected function findFreeColumn($table, $column) {
    *
    * @todo Write a test to ensure a field named "value" doesn't break this.
    */
-  protected function createFieldTable(FieldInterface $field = NULL, $db, $type = 'field') {
+  protected function createFieldTable(FieldInterface $field = NULL, array $db, $type = 'field') {
     $new_table = !$this->database->schema()->tableExists($db['table']);
     if ($new_table) {
       $table = [
@@ -1055,7 +1055,7 @@ protected function fieldsUpdated(IndexInterface $index) {
    * @param string $index_table
    *   The table which stores the denormalized data for this field.
    */
-  protected function removeFieldStorage($name, $field, $index_table) {
+  protected function removeFieldStorage($name, array $field, $index_table) {
     if ($this->getDataTypeHelper()->isTextType($field['type'])) {
       // Remove data from the text table.
       $this->database->delete($field['table'])
@@ -1801,7 +1801,7 @@ protected function splitKeys($keys) {
    * @return array
    *   The processed keywords.
    */
-  protected function eliminateDuplicates($keys, &$words = []) {
+  protected function eliminateDuplicates(array $keys, array &$words = []) {
     foreach ($keys as $i => $word) {
       if (!Element::child($i)) {
         continue;
diff --git a/modules/search_api_db/tests/fixtures/update/search-api-db-base.php b/modules/search_api_db/tests/fixtures/update/search-api-db-base.php
index 42496b35..655c9a63 100644
--- a/modules/search_api_db/tests/fixtures/update/search-api-db-base.php
+++ b/modules/search_api_db/tests/fixtures/update/search-api-db-base.php
@@ -2,8 +2,9 @@
 
 /**
  * @file
- * Contains database additions to drupal-8.bare.standard.php.gz for setting up a
- * base Search API DB installation.
+ * Contains database additions to drupal-8.bare.standard.php.gz.
+ *
+ * Can be used for setting up a base Search API DB installation.
  */
 
 use Drupal\Core\Database\Database;
diff --git a/modules/search_api_db/tests/fixtures/update/search-api-db-update-8102.php b/modules/search_api_db/tests/fixtures/update/search-api-db-update-8102.php
index 7d736856..0e42bde4 100644
--- a/modules/search_api_db/tests/fixtures/update/search-api-db-update-8102.php
+++ b/modules/search_api_db/tests/fixtures/update/search-api-db-update-8102.php
@@ -2,8 +2,9 @@
 
 /**
  * @file
- * Contains database additions to drupal-8.bare.standard.php.gz for testing the
- * search_api_db_update_8102() update.
+ * Contains database additions to drupal-8.bare.standard.php.gz.
+ *
+ * Used for testing the search_api_db_update_8102() update.
  *
  * @see \Drupal\search_api_db\Tests\Update\SearchApiDbUpdate8102Test
  */
diff --git a/phpcs.xml b/phpcs.xml
index 8e7b0b8b..6bbf6cc0 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -10,69 +10,34 @@
   <rule ref="Drupal.Classes.ClassDeclaration"/>
   <rule ref="Drupal.Classes.FullyQualifiedNamespace"/>
   <rule ref="Drupal.Classes.UnusedUseStatement"/>
+  <rule ref="Drupal.Classes.UseLeadingBackslash"/>
   <rule ref="Drupal.CSS.ClassDefinitionNameSpacing"/>
   <rule ref="Drupal.CSS.ColourDefinition"/>
-  <rule ref="Drupal.Commenting.ClassComment">
-    <exclude name="Drupal.Commenting.ClassComment.Missing"/>
-  </rule>
-  <rule ref="Drupal.Commenting.DocComment">
-    <!-- Sniff for these errors: SpacingAfterTagGroup, WrongEnd, SpacingBetween,
-      ContentAfterOpen, SpacingBeforeShort, TagValueIndent, ShortStartSpace,
-      SpacingAfter -->
-    <exclude name="Drupal.Commenting.DocComment.LongNotCapital"/>
-    <!-- ParamNotFirst still not decided for PHPUnit-based tests.
-      @see https://www.drupal.org/node/2253915 -->
-    <exclude name="Drupal.Commenting.DocComment.ParamNotFirst"/>
-    <exclude name="Drupal.Commenting.DocComment.SpacingBeforeTags"/>
-    <exclude name="Drupal.Commenting.DocComment.LongFullStop"/>
-    <exclude name="Drupal.Commenting.DocComment.ShortNotCapital"/>
-    <exclude name="Drupal.Commenting.DocComment.ShortFullStop"/>
-    <!-- TagsNotGrouped and ParamGroup have false-positives.
-      @see https://www.drupal.org/node/2060925 -->
-    <exclude name="Drupal.Commenting.DocComment.TagsNotGrouped"/>
-    <exclude name="Drupal.Commenting.DocComment.ParamGroup"/>
-    <exclude name="Drupal.Commenting.DocComment.ShortSingleLine"/>
-    <exclude name="Drupal.Commenting.DocComment.TagGroupSpacing"/>
-    <exclude name="Drupal.Commenting.DocComment.MissingShort"/>
-  </rule>
+  <rule ref="Drupal.Commenting.ClassComment"/>
+  <rule ref="Drupal.Commenting.DocComment"/>
   <rule ref="Drupal.Commenting.DocCommentStar"/>
   <rule ref="Drupal.Commenting.FileComment"/>
-  <rule ref="Drupal.Commenting.FunctionComment">
-    <exclude name="Drupal.Commenting.FunctionComment.IncorrectTypeHint"/>
-    <exclude name="Drupal.Commenting.FunctionComment.InvalidNoReturn"/>
-    <exclude name="Drupal.Commenting.FunctionComment.InvalidReturnNotVoid"/>
-    <exclude name="Drupal.Commenting.FunctionComment.InvalidTypeHint"/>
-    <exclude name="Drupal.Commenting.FunctionComment.Missing"/>
-    <exclude name="Drupal.Commenting.FunctionComment.MissingFile"/>
-    <exclude name="Drupal.Commenting.FunctionComment.MissingParamComment"/>
-    <exclude name="Drupal.Commenting.FunctionComment.MissingParamName"/>
-    <exclude name="Drupal.Commenting.FunctionComment.MissingParamType"/>
-    <exclude name="Drupal.Commenting.FunctionComment.MissingReturnComment"/>
-    <exclude name="Drupal.Commenting.FunctionComment.MissingReturnType"/>
-    <exclude name="Drupal.Commenting.FunctionComment.ParamCommentFullStop"/>
-    <exclude name="Drupal.Commenting.FunctionComment.ParamCommentNotCapital"/>
-    <exclude name="Drupal.Commenting.FunctionComment.ParamNameNoMatch"/>
-    <exclude name="Drupal.Commenting.FunctionComment.TypeHintMissing"/>
-  </rule>
+  <rule ref="Drupal.Commenting.FunctionComment"/>
   <rule ref="Drupal.ControlStructures.ElseIf"/>
   <rule ref="Drupal.ControlStructures.ControlSignature"/>
   <rule ref="Drupal.Files.EndFileNewline"/>
   <rule ref="Drupal.Files.TxtFileLineLength"/>
+  <rule ref="Drupal.Formatting.MultiLineAssignment"/>
   <rule ref="Drupal.Formatting.SpaceInlineIf"/>
   <rule ref="Drupal.Formatting.SpaceUnaryOperator"/>
   <rule ref="Drupal.Functions.DiscouragedFunctions"/>
-  <rule ref="Drupal.Functions.FunctionDeclaration.SpaceAfter"/>
-  <rule ref="Drupal.Functions.FunctionDeclaration.SpaceBeforeParenthesis"/>
+  <rule ref="Drupal.Functions.FunctionDeclaration"/>
   <rule ref="Drupal.InfoFiles.AutoAddedKeys"/>
   <rule ref="Drupal.InfoFiles.ClassFiles"/>
   <rule ref="Drupal.InfoFiles.DuplicateEntry"/>
   <rule ref="Drupal.InfoFiles.Required"/>
-  <rule ref="Drupal.Semantics.EmptyInstall"/>
-  <rule ref="Drupal.Semantics.FunctionT">
-    <exclude name="Drupal.Semantics.FunctionT.BackslashSingleQuote"/>
-    <exclude name="Drupal.Semantics.FunctionT.NotLiteralString"/>
-    <exclude name="Drupal.Semantics.FunctionT.ConcatString"/>
+  <rule ref="Drupal.NamingConventions.ValidVariableName">
+    <!-- Sniff for: LowerStart -->
+    <exclude name="Drupal.NamingConventions.ValidVariableName.LowerCamelName"/>
   </rule>
+  <rule ref="Drupal.Scope.MethodScope"/>
+  <rule ref="Drupal.Semantics.EmptyInstall"/>
+  <rule ref="Drupal.Semantics.FunctionT"/>
   <rule ref="Drupal.Semantics.FunctionWatchdog"/>
   <rule ref="Drupal.Semantics.InstallHooks"/>
   <rule ref="Drupal.Semantics.LStringTranslatable"/>
@@ -80,23 +45,29 @@
   <rule ref="Drupal.Semantics.TInHookMenu"/>
   <rule ref="Drupal.Semantics.TInHookSchema"/>
   <rule ref="Drupal.WhiteSpace.Comma"/>
+  <rule ref="Drupal.WhiteSpace.EmptyLines"/>
   <rule ref="Drupal.WhiteSpace.ObjectOperatorIndent"/>
   <rule ref="Drupal.WhiteSpace.ObjectOperatorSpacing"/>
+  <rule ref="Drupal.WhiteSpace.OpenTagNewline"/>
   <rule ref="Drupal.WhiteSpace.OperatorSpacing"/>
+  <rule ref="Drupal.WhiteSpace.ScopeIndent"/>
+
+  <!-- Drupal Practice sniffs -->
+  <rule ref="DrupalPractice.Commenting.ExpectedException"/>
 
   <!-- Generic sniffs -->
   <rule ref="Generic.Files.LineEndings"/>
   <rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
+  <rule ref="Generic.NamingConventions.ConstructorName" />
   <rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
   <rule ref="Generic.PHP.DeprecatedFunctions"/>
   <rule ref="Generic.PHP.DisallowShortOpenTag"/>
   <rule ref="Generic.PHP.UpperCaseConstant"/>
   <rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
+  <rule ref="Generic.Arrays.DisallowLongArraySyntax" />
 
   <!-- PSR-2 sniffs -->
-  <rule ref="PSR2.Classes.PropertyDeclaration">
-    <exclude name="PSR2.Classes.PropertyDeclaration.Underscore"/>
-  </rule>
+  <rule ref="PSR2.Classes.PropertyDeclaration"/>
 
   <!-- Squiz sniffs -->
   <rule ref="Squiz.Strings.ConcatenationSpacing">
diff --git a/search_api.api.php b/search_api.api.php
index 606ac976..7860c9d3 100644
--- a/search_api.api.php
+++ b/search_api.api.php
@@ -134,7 +134,7 @@ function hook_search_api_tracker_info_alter(array &$tracker_info) {
  *
  * @see \Drupal\search_api\Display\DisplayPluginBase
  */
-function hook_search_api_displays_alter(&$displays) {
+function hook_search_api_displays_alter(array &$displays) {
   if (isset($displays['some_key'])) {
     $displays['some_key']['label'] = t('New label for existing Display');
   }
diff --git a/search_api.drush.inc b/search_api.drush.inc
index e13c2383..adbf7162 100644
--- a/search_api.drush.inc
+++ b/search_api.drush.inc
@@ -672,7 +672,7 @@ function drush_search_api_server_clear($server_id = NULL) {
   foreach ($server->getIndexes() as $index) {
     $index->clear();
   }
-  drush_print(dt('All indexes on the search server @server_id were cleared.', array('@server_id' => $server_id)));
+  drush_print(dt('All indexes on the search server @server_id were cleared.', ['@server_id' => $server_id]));
 }
 
 /**
diff --git a/search_api.module b/search_api.module
index 3b14846f..13bf0f04 100644
--- a/search_api.module
+++ b/search_api.module
@@ -154,9 +154,9 @@ function search_api_hook_info() {
     'search_api_query_alter',
     // Unfortunately, it's not possible to add hook infos for hooks with
     // "wildcards".
-//    'search_api_query_TAG_alter',
+    // 'search_api_query_TAG_alter',
     'search_api_results_alter',
-//    'search_api_results_TAG_alter',
+    // 'search_api_results_TAG_alter',
     'search_api_index_reindex',
   ];
   $info = [
diff --git a/search_api.theme.inc b/search_api.theme.inc
index 00aefbe8..4409ac92 100644
--- a/search_api.theme.inc
+++ b/search_api.theme.inc
@@ -25,7 +25,7 @@
  *
  * @ingroup themeable
  */
-function theme_search_api_admin_fields_table($variables) {
+function theme_search_api_admin_fields_table(array $variables) {
   $form = $variables['element'];
   $rows = [];
   if (!empty($form['fields'])) {
@@ -183,7 +183,7 @@ function theme_search_api_form_item_list(array $variables) {
  *
  * @ingroup themeable
  */
-function theme_search_api_server($variables) {
+function theme_search_api_server(array $variables) {
   // Get the search server.
   /** @var $server \Drupal\search_api\ServerInterface */
   $server = $variables['server'];
diff --git a/src/Controller/ExecuteTasksAccessCheck.php b/src/Controller/ExecuteTasksAccessCheck.php
index 98e3720d..9f2f39f3 100644
--- a/src/Controller/ExecuteTasksAccessCheck.php
+++ b/src/Controller/ExecuteTasksAccessCheck.php
@@ -22,6 +22,7 @@ class ExecuteTasksAccessCheck implements AccessInterface {
    * Creates an ExecuteTasksAccessCheck object.
    *
    * @param \Drupal\search_api\Task\TaskManagerInterface $tasksManager
+   *   The tasks manager service.
    */
   public function __construct(TaskManagerInterface $tasksManager) {
     $this->tasksManager = $tasksManager;
diff --git a/src/Controller/IndexController.php b/src/Controller/IndexController.php
index 2743e532..91cfb522 100644
--- a/src/Controller/IndexController.php
+++ b/src/Controller/IndexController.php
@@ -51,6 +51,7 @@ public function getRequestStack() {
    * Retrieves the current request.
    *
    * @return \Symfony\Component\HttpFoundation\Request|null
+   *   The current request.
    */
   public function getRequest() {
     return $this->getRequestStack()->getCurrentRequest();
diff --git a/src/Display/DisplayPluginManager.php b/src/Display/DisplayPluginManager.php
index 065ebc3c..abac905a 100644
--- a/src/Display/DisplayPluginManager.php
+++ b/src/Display/DisplayPluginManager.php
@@ -14,7 +14,7 @@
  * @see \Drupal\search_api\Display\DisplayPluginBase
  * @see plugin_api
  */
-class DisplayPluginManager extends DefaultPluginManager {
+class DisplayPluginManager extends DefaultPluginManager implements DisplayPluginManagerInterface {
 
   /**
    * Static cache for the display plugins.
@@ -35,10 +35,7 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac
   }
 
   /**
-   * Returns all known displays.
-   *
-   * @return \Drupal\search_api\Display\DisplayInterface[]
-   *   An array of display plugins, keyed by type identifier.
+   * {@inheritdoc}
    */
   public function getInstances() {
     if ($this->displays === NULL) {
diff --git a/src/Display/DisplayPluginManagerInterface.php b/src/Display/DisplayPluginManagerInterface.php
new file mode 100644
index 00000000..a1d4c49d
--- /dev/null
+++ b/src/Display/DisplayPluginManagerInterface.php
@@ -0,0 +1,20 @@
+<?php
+
+namespace Drupal\search_api\Display;
+
+use Drupal\Component\Plugin\PluginManagerInterface;
+
+/**
+ * Provides an interface for the display plugin manager service.
+ */
+interface DisplayPluginManagerInterface extends PluginManagerInterface {
+
+  /**
+   * Returns all known displays.
+   *
+   * @return \Drupal\search_api\Display\DisplayInterface[]
+   *   An array of display plugins, keyed by type identifier.
+   */
+  public function getInstances();
+
+}
diff --git a/src/Entity/Index.php b/src/Entity/Index.php
index 9fc5bce9..e957074b 100644
--- a/src/Entity/Index.php
+++ b/src/Entity/Index.php
@@ -517,7 +517,7 @@ public function getProcessors() {
   /**
    * {@inheritdoc}
    */
-  public function getProcessorsByStage($stage, $overrides = []) {
+  public function getProcessorsByStage($stage, array $overrides = []) {
     // Get a list of all processors which support this stage, along with their
     // weights.
     $processors = $this->getProcessors();
diff --git a/src/Form/IndexForm.php b/src/Form/IndexForm.php
index 71f0f21f..728ad16a 100644
--- a/src/Form/IndexForm.php
+++ b/src/Form/IndexForm.php
@@ -420,7 +420,7 @@ public function buildTrackerConfigForm(array &$form, FormStateInterface $form_st
    * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current form state.
    */
-  public function submitAjaxDatasourceConfigForm($form, FormStateInterface $form_state) {
+  public function submitAjaxDatasourceConfigForm(array $form, FormStateInterface $form_state) {
     $form_state->setValue('id', NULL);
     $form_state->setRebuild();
   }
diff --git a/src/Form/IndexProcessorsForm.php b/src/Form/IndexProcessorsForm.php
index 66966f97..87682072 100644
--- a/src/Form/IndexProcessorsForm.php
+++ b/src/Form/IndexProcessorsForm.php
@@ -54,6 +54,7 @@ class IndexProcessorsForm extends EntityForm {
    * @param \Drupal\search_api\Processor\ProcessorPluginManager $processor_plugin_manager
    *   The processor plugin manager.
    * @param \Psr\Log\LoggerInterface $logger
+   *   The logger.
    */
   public function __construct(EntityTypeManagerInterface $entity_type_manager, ProcessorPluginManager $processor_plugin_manager, LoggerInterface $logger) {
     $this->entityTypeManager = $entity_type_manager;
diff --git a/src/Form/ServerClearConfirmForm.php b/src/Form/ServerClearConfirmForm.php
index 7f0d6d9e..315bd2eb 100644
--- a/src/Form/ServerClearConfirmForm.php
+++ b/src/Form/ServerClearConfirmForm.php
@@ -24,7 +24,7 @@ public function getQuestion() {
    * {@inheritdoc}
    */
   public function getDescription() {
-    return $this->t('This will permanently remove all data currently indexed on this server for indexes that aren\'t read-only. Items are queued for reindexing. Until reindexing occurs, searches for the affected indexes will not return any results. This action cannot be undone.');
+    return $this->t("This will permanently remove all data currently indexed on this server for indexes that aren't read-only. Items are queued for reindexing. Until reindexing occurs, searches for the affected indexes will not return any results. This action cannot be undone.");
   }
 
   /**
diff --git a/src/IndexInterface.php b/src/IndexInterface.php
index 03e16279..17360ab8 100644
--- a/src/IndexInterface.php
+++ b/src/IndexInterface.php
@@ -280,7 +280,7 @@ public function getProcessors();
    *   An array of all enabled processors that support the given stage, ordered
    *   by the weight for that stage.
    */
-  public function getProcessorsByStage($stage, $overrides = []);
+  public function getProcessorsByStage($stage, array $overrides = []);
 
   /**
    * Determines whether the given processor ID is valid for this index.
diff --git a/src/LoggerTrait.php b/src/LoggerTrait.php
index dda90a02..b958db56 100644
--- a/src/LoggerTrait.php
+++ b/src/LoggerTrait.php
@@ -62,7 +62,7 @@ public function setLogger(LoggerInterface $logger) {
    * @see watchdog_exception()
    * @see \Drupal\Core\Utility\Error::decodeException()
    */
-  protected function logException(\Exception $exception, $message = NULL, $variables = [], $severity = RfcLogLevel::ERROR, $link = NULL) {
+  protected function logException(\Exception $exception, $message = NULL, array $variables = [], $severity = RfcLogLevel::ERROR, $link = NULL) {
     // Use a default value if $message is not set.
     if (empty($message)) {
       $message = '%type: @message in %function (line %line of %file).';
diff --git a/src/Plugin/search_api/data_type/value/TextValueInterface.php b/src/Plugin/search_api/data_type/value/TextValueInterface.php
index 9c010083..2b4b601b 100644
--- a/src/Plugin/search_api/data_type/value/TextValueInterface.php
+++ b/src/Plugin/search_api/data_type/value/TextValueInterface.php
@@ -104,11 +104,11 @@ public function getProperty($name, $default = NULL);
    * Sets the properties of this text value.
    *
    * @param array $properties
-   *   An associative array of properties.
+   *   An associative array of property values.
    *
    * @return $this
    */
-  public function setProperties($properties);
+  public function setProperties(array $properties);
 
   /**
    * Sets the properties of this text value.
diff --git a/src/Plugin/search_api/processor/AddHierarchy.php b/src/Plugin/search_api/processor/AddHierarchy.php
index d09a9b05..abd3e2e9 100644
--- a/src/Plugin/search_api/processor/AddHierarchy.php
+++ b/src/Plugin/search_api/processor/AddHierarchy.php
@@ -16,6 +16,8 @@
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
+ * Adds all ancestors' IDs to a hierarchical field.
+ *
  * @SearchApiProcessor(
  *   id = "hierarchy",
  *   label = @Translation("Index hierarchy"),
diff --git a/src/Plugin/search_api/processor/Resources/Porter2.php b/src/Plugin/search_api/processor/Resources/Porter2.php
index 102b8e8f..663cde52 100644
--- a/src/Plugin/search_api/processor/Resources/Porter2.php
+++ b/src/Plugin/search_api/processor/Resources/Porter2.php
@@ -49,7 +49,7 @@ class Porter2 {
    * @param string[] $custom_exceptions
    *   (optional) A custom list of exceptions.
    */
-  public function __construct($word, $custom_exceptions = []) {
+  public function __construct($word, array $custom_exceptions = []) {
     $this->word = $word;
     $this->exceptions = $custom_exceptions + [
       'skis' => 'ski',
@@ -404,7 +404,7 @@ protected function removeDoubles() {
    * @return bool
    *   TRUE if the character is a vowel, FALSE otherwise.
    */
-  protected function isVowel($position, $word = NULL, $additional = []) {
+  protected function isVowel($position, $word = NULL, array $additional = []) {
     if ($word === NULL) {
       $word = $this->word;
     }
diff --git a/src/Plugin/views/field/SearchApiFieldTrait.php b/src/Plugin/views/field/SearchApiFieldTrait.php
index 6f6fb0ff..e241a55f 100644
--- a/src/Plugin/views/field/SearchApiFieldTrait.php
+++ b/src/Plugin/views/field/SearchApiFieldTrait.php
@@ -21,6 +21,11 @@
  *
  * Multi-valued field handling is taken from
  * \Drupal\views\Plugin\views\field\PrerenderList.
+ *
+ * Note: Some method parameters are documented as type array|\ArrayAccess. This
+ * is just done to avoid the code sniffer complaining about the missing "array"
+ * type hint (since it's impossible to add it, due to the Views parent plugin
+ * classes not having that type hint, either).
  */
 trait SearchApiFieldTrait {
 
@@ -186,7 +191,7 @@ public function defineOptions() {
   /**
    * Provide a form to edit options for this plugin.
    *
-   * @param array $form
+   * @param array|\ArrayAccess $form
    *   The existing form structure, passed by reference.
    * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The current form state.
@@ -372,7 +377,7 @@ public function getValue(ResultRow $values, $field = NULL) {
    * This gives the handlers some time to set up before any handler has
    * been rendered.
    *
-   * @param \Drupal\views\ResultRow[] $values
+   * @param \Drupal\views\ResultRow[]|\ArrayAccess $values
    *   An array of all ResultRow objects returned from the query.
    *
    * @see \Drupal\views\Plugin\views\field\FieldHandlerInterface::preRender()
@@ -757,7 +762,7 @@ public function getItems(ResultRow $values) {
   /**
    * Renders all items in this field together.
    *
-   * @param array $items
+   * @param array|\ArrayAccess $items
    *   The items provided by getItems() for a single row.
    *
    * @return string
diff --git a/src/Plugin/views/query/SearchApiQuery.php b/src/Plugin/views/query/SearchApiQuery.php
index 3d1bdb5f..5760653f 100644
--- a/src/Plugin/views/query/SearchApiQuery.php
+++ b/src/Plugin/views/query/SearchApiQuery.php
@@ -241,7 +241,7 @@ public function addRetrievedProperty($combined_property_path) {
    * @see \Drupal\views\Plugin\views\query\Sql::addField()
    * @see \Drupal\search_api\Plugin\views\query\SearchApiQuery::addField()
    */
-  public function addField($table, $field, $alias = '', $params = []) {
+  public function addField($table, $field, $alias = '', array $params = []) {
     $this->addRetrievedProperty($field);
     return $field;
   }
@@ -755,7 +755,7 @@ public function keys($keys = NULL) {
    *
    * @see \Drupal\search_api\Query\QueryInterface::setFulltextFields()
    */
-  public function setFulltextFields($fields = NULL) {
+  public function setFulltextFields(array $fields = NULL) {
     if (!$this->shouldAbort()) {
       $this->query->setFulltextFields($fields);
     }
@@ -1071,7 +1071,7 @@ public function sort($field, $order = 'ASC') {
    *
    * @see \Drupal\views\Plugin\views\query\Sql::addOrderBy()
    */
-  public function addOrderBy($table, $field = NULL, $order = 'ASC', $alias = '', $params = []) {
+  public function addOrderBy($table, $field = NULL, $order = 'ASC', $alias = '', array $params = []) {
     $server = $this->getIndex()->getServerInstance();
     if ($table == 'rand') {
       if ($server->supportsFeature('search_api_random_sort')) {
diff --git a/src/Query/Query.php b/src/Query/Query.php
index 9da873d5..fd53cb45 100644
--- a/src/Query/Query.php
+++ b/src/Query/Query.php
@@ -5,6 +5,7 @@
 use Drupal\Core\DependencyInjection\DependencySerializationTrait;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\StringTranslation\StringTranslationTrait;
+use Drupal\search_api\Display\DisplayPluginManagerInterface;
 use Drupal\search_api\IndexInterface;
 use Drupal\search_api\ParseMode\ParseModeInterface;
 use Drupal\search_api\ParseMode\ParseModePluginManager;
@@ -164,7 +165,7 @@ class Query implements QueryInterface {
   /**
    * The display plugin manager.
    *
-   * @var \Drupal\search_api\Display\DisplayPluginManager|null
+   * @var \Drupal\search_api\Display\DisplayPluginManagerInterface|null
    */
   protected $displayPluginManager;
 
@@ -256,7 +257,7 @@ public function setParseModeManager(ParseModePluginManager $parse_mode_manager)
   /**
    * Retrieves the display plugin manager.
    *
-   * @return \Drupal\search_api\Display\DisplayPluginManager
+   * @return \Drupal\search_api\Display\DisplayPluginManagerInterface
    *   The display plugin manager.
    */
   public function getDisplayPluginManager() {
@@ -266,12 +267,12 @@ public function getDisplayPluginManager() {
   /**
    * Sets the display plugin manager.
    *
-   * @param \Drupal\search_api\Display\DisplayPluginManager $display_plugin_manager
+   * @param \Drupal\search_api\Display\DisplayPluginManagerInterface $display_plugin_manager
    *   The new display plugin manager.
    *
    * @return $this
    */
-  public function setDisplayPluginManager($display_plugin_manager) {
+  public function setDisplayPluginManager(DisplayPluginManagerInterface $display_plugin_manager) {
     $this->displayPluginManager = $display_plugin_manager;
     return $this;
   }
diff --git a/src/Task/IndexTaskManager.php b/src/Task/IndexTaskManager.php
index d4f57491..b85ffb19 100644
--- a/src/Task/IndexTaskManager.php
+++ b/src/Task/IndexTaskManager.php
@@ -62,7 +62,7 @@ public static function getSubscribedEvents() {
   /**
    * Processes all pending index tasks inside a batch run.
    *
-   * @param array $context
+   * @param array|\ArrayAccess $context
    *   The current batch context.
    * @param \Drupal\Core\Config\ConfigImporter $config_importer
    *   The config importer.
diff --git a/src/Task/TaskManager.php b/src/Task/TaskManager.php
index fc4e1de4..606ce109 100644
--- a/src/Task/TaskManager.php
+++ b/src/Task/TaskManager.php
@@ -277,7 +277,7 @@ public function setTasksBatch(array $conditions = []) {
    * @param array $conditions
    *   An array of conditions defining the tasks to be executed. Should be used
    *   to retrieve more task IDs if necessary.
-   * @param array $context
+   * @param array|\ArrayAccess $context
    *   The context of the current batch, as defined in the @link batch Batch
    *   operations @endlink documentation.
    *
diff --git a/src/Utility/FieldsHelperInterface.php b/src/Utility/FieldsHelperInterface.php
index ea2f0e03..31a0f58e 100644
--- a/src/Utility/FieldsHelperInterface.php
+++ b/src/Utility/FieldsHelperInterface.php
@@ -211,7 +211,7 @@ public function createItemFromObject(IndexInterface $index, ComplexDataInterface
    * @return \Drupal\search_api\Item\FieldInterface
    *   A new field object.
    */
-  public function createField(IndexInterface $index, $fieldIdentifier, $fieldInfo = []);
+  public function createField(IndexInterface $index, $fieldIdentifier, array $fieldInfo = []);
 
   /**
    * Creates a new field on an index based on a property.
diff --git a/tests/search_api_test/src/TestPluginTrait.php b/tests/search_api_test/src/TestPluginTrait.php
index fb31290f..1bce7a17 100644
--- a/tests/search_api_test/src/TestPluginTrait.php
+++ b/tests/search_api_test/src/TestPluginTrait.php
@@ -121,7 +121,7 @@ protected function getPluginType() {
    *
    * @see \Drupal\search_api_test\TestPluginTrait::getMethodOverride()
    */
-  public function __call($name, $arguments) {
+  public function __call($name, array $arguments) {
     if ($override = $this->getMethodOverride($name)) {
       array_unshift($arguments, $this);
       return call_user_func_array($override, $arguments);
diff --git a/tests/search_api_test_hooks/search_api_test_hooks.search_api.inc b/tests/search_api_test_hooks/search_api_test_hooks.search_api.inc
index 86363341..9a85b5d0 100644
--- a/tests/search_api_test_hooks/search_api_test_hooks.search_api.inc
+++ b/tests/search_api_test_hooks/search_api_test_hooks.search_api.inc
@@ -50,14 +50,14 @@ function search_api_test_hooks_search_api_processor_info_alter(array &$processor
 }
 
 /**
- * Implements hook_search_api_tracker_info_alter.
+ * Implements hook_search_api_tracker_info_alter().
  */
 function search_api_test_hooks_search_api_tracker_info_alter(array &$tracker_info) {
   $tracker_info['search_api_test']['label'] = 'Good luck';
 }
 
 /**
- * Implements hook_search_api_displays_alter
+ * Implements hook_search_api_displays_alter().
  */
 function search_api_test_hooks_search_api_displays_alter(array &$displays) {
   if (isset($displays['views_page:search_api_test_view__page_1'])) {
diff --git a/tests/src/Kernel/DependencyRemovalTest.php b/tests/src/Kernel/DependencyRemovalTest.php
index 9113a553..effd32eb 100644
--- a/tests/src/Kernel/DependencyRemovalTest.php
+++ b/tests/src/Kernel/DependencyRemovalTest.php
@@ -217,7 +217,7 @@ public function testBackendDependency($remove_dependency) {
       //   does not seem to follow that logic, but just computes the complete
       //   tree of dependencies once and operates generally on the assumption
       //   that all of them will be deleted. See #2642374.
-//      $this->assertEquals($server->id(), $this->index->getServerId(), "Index's server was not changed");
+      // $this->assertEquals($server->id(), $this->index->getServerId(), "Index's server was not changed");
     }
     else {
       $this->assertNull($server, 'Server was removed');
diff --git a/tests/src/Kernel/Processor/AddHierarchyTest.php b/tests/src/Kernel/Processor/AddHierarchyTest.php
index 63116eb7..e2652c88 100644
--- a/tests/src/Kernel/Processor/AddHierarchyTest.php
+++ b/tests/src/Kernel/Processor/AddHierarchyTest.php
@@ -207,19 +207,20 @@ public function createVocabulary() {
    * @return \Drupal\taxonomy\Entity\Term
    *   The new taxonomy term object.
    */
-  public function createTerm(VocabularyInterface $vocabulary, $values = []) {
+  public function createTerm(VocabularyInterface $vocabulary, array $values = []) {
     $filter_formats = filter_formats();
     $format = array_pop($filter_formats);
-    $term = Term::create($values + [
-        'name' => $this->randomMachineName(),
-        'description' => [
-          'value' => $this->randomMachineName(),
-          // Use the first available text format.
-          'format' => $format->id(),
-        ],
-        'vid' => $vocabulary->id(),
-        'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
-      ]);
+    $values += [
+      'name' => $this->randomMachineName(),
+      'description' => [
+        'value' => $this->randomMachineName(),
+        // Use the first available text format.
+        'format' => $format->id(),
+      ],
+      'vid' => $vocabulary->id(),
+      'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
+    ];
+    $term = Term::create($values);
     $term->save();
     return $term;
   }
diff --git a/tests/src/Kernel/Processor/ContentAccessTest.php b/tests/src/Kernel/Processor/ContentAccessTest.php
index 249a5270..252fc3c7 100644
--- a/tests/src/Kernel/Processor/ContentAccessTest.php
+++ b/tests/src/Kernel/Processor/ContentAccessTest.php
@@ -356,7 +356,7 @@ public function testAlterPropertyDefinitions() {
    * @return \Drupal\user\UserInterface
    *   The new user object.
    */
-  protected function createUser($permissions) {
+  protected function createUser(array $permissions) {
     $role = Role::create(['id' => 'role', 'name' => 'Role test']);
     $role->save();
     user_role_grant_permissions($role->id(), $permissions);
diff --git a/tests/src/Unit/Plugin/Processor/AggregatedFieldsTest.php b/tests/src/Unit/Plugin/Processor/AggregatedFieldsTest.php
index 4789215a..01a982c1 100644
--- a/tests/src/Unit/Plugin/Processor/AggregatedFieldsTest.php
+++ b/tests/src/Unit/Plugin/Processor/AggregatedFieldsTest.php
@@ -142,7 +142,7 @@ protected function setUp() {
    *
    * @dataProvider aggregationTestsDataProvider
    */
-  public function testAggregation($type, $expected, $integer = FALSE) {
+  public function testAggregation($type, array $expected, $integer = FALSE) {
     // Add the field configuration.
     $configuration = [
       'type' => $type,
