diff --git a/modules/jsonapi_defaults/src/Controller/EntityResource.php b/modules/jsonapi_defaults/src/Controller/EntityResource.php
index 7a2d14cbbaa1331b4b48cfc488f21f2409adadc1..a03543ba0e76f22d3589f4a0dba7f4161328d7f4 100644
--- a/modules/jsonapi_defaults/src/Controller/EntityResource.php
+++ b/modules/jsonapi_defaults/src/Controller/EntityResource.php
@@ -171,7 +171,7 @@ class EntityResource extends JsonApiEntityResourse {
       );
       throw new \LengthException($message);
     }
-    return isset($relatable_resource_types[0]) ? $relatable_resource_types[0] : NULL;
+    return $relatable_resource_types[0] ?? NULL;
   }
 
   /**
@@ -188,7 +188,7 @@ class EntityResource extends JsonApiEntityResourse {
     $keys = explode('#', $path);
 
     foreach ($keys as $key) {
-      $arr = &$arr[$key];
+      $arr = $arr[$key];
     }
 
     $arr = $value;
diff --git a/modules/jsonapi_defaults/tests/src/Functional/JsonApiDefaultsFunctionalTest.php b/modules/jsonapi_defaults/tests/src/Functional/JsonApiDefaultsFunctionalTest.php
index 6f369d64c730fc73891de6a98f51566baa8f8670..1069580cc23a574b546f39fe7e428d9587a68f4b 100644
--- a/modules/jsonapi_defaults/tests/src/Functional/JsonApiDefaultsFunctionalTest.php
+++ b/modules/jsonapi_defaults/tests/src/Functional/JsonApiDefaultsFunctionalTest.php
@@ -7,7 +7,6 @@ use Drupal\jsonapi\Query\OffsetPage;
 use Drupal\jsonapi_extras\Entity\JsonapiResourceConfig;
 use Drupal\Tests\jsonapi_extras\Functional\JsonApiExtrasFunctionalTestBase;
 use GuzzleHttp\Psr7\Query;
-use function GuzzleHttp\Psr7\parse_query;
 
 /**
  * The test class for the JSON API Defaults functionality.
@@ -28,39 +27,38 @@ class JsonApiDefaultsFunctionalTest extends JsonApiExtrasFunctionalTestBase {
     'jsonapi_defaults',
   ];
 
-    /**
-     * Test regression on sorting from issue 3322635.
-     */
-    public function testSortRegression3322635() {
-        $this->setResouceConfigValue([
-            'default_filter' => [],
-            'default_sorting' => [],
-        ]);
-
-        $this->createDefaultContent(2, 5, TRUE, TRUE, static::IS_NOT_MULTILINGUAL);
+  /**
+   * Test regression on sorting from issue 3322635.
+   */
+  public function testSortRegression3322635() {
+    $this->setResouceConfigValue([
+      'default_filter' => [],
+      'default_sorting' => [],
+    ]);
 
-        $this->nodes[0]->title->setValue('b');
-        $this->nodes[0]->save();
+    $this->createDefaultContent(2, 5, TRUE, TRUE, static::IS_NOT_MULTILINGUAL);
 
-        $this->nodes[1]->title->setValue('a');
-        $this->nodes[1]->save();
+    $this->nodes[0]->title->setValue('b');
+    $this->nodes[0]->save();
 
-        $stringResponse = $this->drupalGet('/api/articles', ['query' => ['sort' => 'title']]);
-        $output = Json::decode($stringResponse);
+    $this->nodes[1]->title->setValue('a');
+    $this->nodes[1]->save();
 
-        // Check if order changed as expected.
-        $this->assertEquals('a', $output['data'][0]['attributes']['title']);
-        $this->assertEquals('b', $output['data'][1]['attributes']['title']);
+    $stringResponse = $this->drupalGet('/api/articles', ['query' => ['sort' => 'title']]);
+    $output = Json::decode($stringResponse);
 
-        $stringResponse = $this->drupalGet('/api/articles', ['query' => ['sort' => '-title']]);
-        $output = Json::decode($stringResponse);
+    // Check if order changed as expected.
+    $this->assertEquals('a', $output['data'][0]['attributes']['title']);
+    $this->assertEquals('b', $output['data'][1]['attributes']['title']);
 
-        // Check if order changed as expected.
-        $this->assertEquals('b', $output['data'][0]['attributes']['title']);
-        $this->assertEquals('a', $output['data'][1]['attributes']['title']);
+    $stringResponse = $this->drupalGet('/api/articles', ['query' => ['sort' => '-title']]);
+    $output = Json::decode($stringResponse);
 
-    }
+    // Check if order changed as expected.
+    $this->assertEquals('b', $output['data'][0]['attributes']['title']);
+    $this->assertEquals('a', $output['data'][1]['attributes']['title']);
 
+  }
 
   /**
    * Test the GET method.
diff --git a/src/EventSubscriber/JsonApiBuildSubscriber.php b/src/EventSubscriber/JsonApiBuildSubscriber.php
index efe67c1e0d2075c4c36746148368c24eea6bff22..bcddc0d5be2fce02e8874d7b0b58a70abb9dc8a4 100644
--- a/src/EventSubscriber/JsonApiBuildSubscriber.php
+++ b/src/EventSubscriber/JsonApiBuildSubscriber.php
@@ -17,6 +17,8 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
 class JsonApiBuildSubscriber implements EventSubscriberInterface {
 
   /**
+   * The provider repository under test.
+   *
    * @var \Drupal\jsonapi_extras\ResourceType\ConfigurableResourceTypeRepository
    *  The extra's resource repository
    */
@@ -40,8 +42,7 @@ class JsonApiBuildSubscriber implements EventSubscriberInterface {
   public function __construct(ConfigurableResourceTypeRepository $repository, ConfigFactoryInterface $configFactory = NULL) {
     $this->repository = $repository;
     if ($configFactory === NULL) {
-      @trigger_error('Calling ' . __METHOD__ . ' without the $configFactory argument is deprecated in jsonapi_extras:8.x-3.x and will be required in jsonapi_extras:8.x-4.x. See https://www.drupal.org/node/3242191', E_USER_DEPRECATED);
-      $configFactory = \Drupal::configFactory();
+      @trigger_error('Calling ' . __METHOD__ . ' without the $configFactory argument is deprecated in jsonapi_extras:8.x-3.23 and will be required in jsonapi_extras:8.x-4.0. See https://www.drupal.org/node/3242191', E_USER_DEPRECATED);
     }
     $this->configFactory = $configFactory;
   }
diff --git a/src/Form/JsonapiResourceConfigForm.php b/src/Form/JsonapiResourceConfigForm.php
index 15ed1c984f38df2a7f866e09b1ee2fe9b1db05c1..21859dcdfc2394d5dbc6fbe7e0c1ff8e3faaa77b 100644
--- a/src/Form/JsonapiResourceConfigForm.php
+++ b/src/Form/JsonapiResourceConfigForm.php
@@ -151,7 +151,7 @@ class JsonapiResourceConfigForm extends EntityForm {
         // We can't build the form without an entity type and bundle.
         throw new \InvalidArgumentException('Unable to load entity type or bundle for the overrides form.');
       }
-      list($entity_type_id, $bundle) = explode('--', $resource_id);
+      [$entity_type_id, $bundle] = explode('--', $resource_id);
       $form['#title'] = $this->t('Edit %label resource config', ['%label' => $resource_id]);
     }
 
@@ -414,7 +414,7 @@ class JsonapiResourceConfigForm extends EntityForm {
       ],
     ];
     $overrides_form['advancedOptions'] = [
-      '#markup' => t('Advanced'),
+      '#markup' => $this->t('Advanced'),
     ];
 
     $overrides_form['advancedOptionsIcon'] = [
diff --git a/src/JsonapiResourceConfigListBuilder.php b/src/JsonapiResourceConfigListBuilder.php
index e2282ec5c9e77c49c8c9e4b71e0140d22ec0f7df..f19d89dbb60f1bb8876732f46e5ee00e13ea1784 100644
--- a/src/JsonapiResourceConfigListBuilder.php
+++ b/src/JsonapiResourceConfigListBuilder.php
@@ -9,7 +9,6 @@ use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Url;
 use Drupal\jsonapi\ResourceType\ResourceTypeRepositoryInterface;
-use Drupal\jsonapi_extras\Entity\JsonapiResourceConfig;
 use Drupal\jsonapi_extras\ResourceType\ConfigurableResourceType;
 use Drupal\jsonapi_extras\ResourceType\NullJsonapiResourceConfig;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -47,7 +46,7 @@ class JsonapiResourceConfigListBuilder extends ConfigEntityListBuilder {
    *   The entity type.
    * @param \Drupal\Core\Entity\EntityStorageInterface $storage
    *   The storage.
-   * @param ResourceTypeRepositoryInterface $resource_type_repository
+   * @param \Drupal\jsonapi\ResourceType\ResourceTypeRepositoryInterface $resource_type_repository
    *   The JSON:API resource type repository.
    * @param \Drupal\Core\Config\ImmutableConfig $config
    *   The config instance.
@@ -60,7 +59,7 @@ class JsonapiResourceConfigListBuilder extends ConfigEntityListBuilder {
     $this->config = $config;
     if ($entityTypeManager === NULL) {
       $entityTypeManager = \Drupal::entityTypeManager();
-      @trigger_error('Calling ' . __METHOD__ . ' without the $entityTypeManager argument is deprecated in jsonapi_extras:8.x-3.x and will be required in jsonapi_extras:8.x-4.x. See https://www.drupal.org/node/3242791', E_USER_DEPRECATED);
+      @trigger_error('Calling ' . __METHOD__ . ' without the $entityTypeManager argument is deprecated in jsonapi_extras:8.x-3.23 and will be required in jsonapi_extras:8.x-4.0. See https://www.drupal.org/node/3242791', E_USER_DEPRECATED);
     }
     $this->entityTypeManager = $entityTypeManager;
   }
@@ -97,8 +96,8 @@ class JsonapiResourceConfigListBuilder extends ConfigEntityListBuilder {
   public function render() {
     $list = [];
     $resource_status = [
-      'enabled' => t('Enabled Resources'),
-      'disabled' => t('Disabled resources'),
+      'enabled' => $this->t('Enabled Resources'),
+      'disabled' => $this->t('Disabled resources'),
     ];
 
     $title = $this->t('Filter resources by name, entity type, bundle or path.');
@@ -185,7 +184,7 @@ class JsonapiResourceConfigListBuilder extends ConfigEntityListBuilder {
         }
         $default_group = 'disabled';
       }
-      else if (!$resource_config && $resource_type->isInternal()) {
+      elseif (!$resource_config && $resource_type->isInternal()) {
         continue;
       }
 
@@ -221,7 +220,7 @@ class JsonapiResourceConfigListBuilder extends ConfigEntityListBuilder {
               ]),
             ],
           ],
-        ]: [],
+        ] : [],
       ];
 
       if ($resource_config && !($resource_config instanceof NullJsonapiResourceConfig)) {
diff --git a/src/Normalizer/SchemataSchemaNormalizer.php b/src/Normalizer/SchemataSchemaNormalizer.php
index 8374f35d1909b1b21f1bcd4119b9f47cf81e093f..db089bec15c008efa29b9b199b4fc0055503751d 100644
--- a/src/Normalizer/SchemataSchemaNormalizer.php
+++ b/src/Normalizer/SchemataSchemaNormalizer.php
@@ -47,6 +47,7 @@ class SchemataSchemaNormalizer extends SchemataJsonSchemaSchemataSchemaNormalize
       return $normalized;
     }
 
+    $root = '';
     // Alter the attributes according to the resource config.
     if (!empty($normalized['definitions'])) {
       $root = &$normalized['definitions'];
@@ -62,7 +63,10 @@ class SchemataSchemaNormalizer extends SchemataJsonSchemaSchemataSchemaNormalize
       foreach ($properties as $fieldname => $schema) {
         if ($enhancer = $resource_type->getFieldEnhancer($resource_type->getFieldByPublicName($fieldname)->getInternalName())) {
           $root[$property_type]['properties'][$fieldname] = array_merge(
-            array_intersect_key($root[$property_type]['properties'][$fieldname], array_flip(['title', 'description'])),
+            array_intersect_key($root[$property_type]['properties'][$fieldname], array_flip([
+              'title',
+              'description',
+            ])),
             $enhancer->getOutputJsonSchema()
           );
         }
diff --git a/src/ResourceType/ConfigurableResourceTypeRepository.php b/src/ResourceType/ConfigurableResourceTypeRepository.php
index af5846acc003d61e3a9780d3c7645ba1cb806e45..cf7d7741ca86e8cd9b27c343f4718d3e025bd39b 100644
--- a/src/ResourceType/ConfigurableResourceTypeRepository.php
+++ b/src/ResourceType/ConfigurableResourceTypeRepository.php
@@ -175,8 +175,7 @@ class ConfigurableResourceTypeRepository extends ResourceTypeRepository {
     );
     try {
       $resource_configs = $this->getResourceConfigs();
-      return isset($resource_configs[$resource_config_id]) ?
-        $resource_configs[$resource_config_id] :
+      return $resource_configs[$resource_config_id] ??
         $null_resource;
     }
     catch (PluginException $e) {
@@ -196,7 +195,7 @@ class ConfigurableResourceTypeRepository extends ResourceTypeRepository {
     if (!static::$resourceConfigs) {
       $resource_config_ids = [];
       foreach ($this->getEntityTypeBundleTuples() as $tuple) {
-        list($entity_type_id, $bundle) = $tuple;
+        [$entity_type_id, $bundle] = $tuple;
         $resource_config_ids[] = static::buildResourceConfigId(
           $entity_type_id,
           $bundle
@@ -247,7 +246,7 @@ class ConfigurableResourceTypeRepository extends ResourceTypeRepository {
     }
 
     if (strpos($type_name, '--') !== FALSE) {
-      list($entity_type_id, $bundle) = explode('--', $type_name);
+      [$entity_type_id, $bundle] = explode('--', $type_name);
       return static::lookupResourceType($resource_types, $entity_type_id, $bundle);
     }
 
diff --git a/tests/src/Functional/JsonApiExtrasFunctionalTest.php b/tests/src/Functional/JsonApiExtrasFunctionalTest.php
index 61c9b4c589886c16e94e9474c9ee575ce75c745c..30b63fb5a8c6a2044758a351bfb120e62bf9d51b 100644
--- a/tests/src/Functional/JsonApiExtrasFunctionalTest.php
+++ b/tests/src/Functional/JsonApiExtrasFunctionalTest.php
@@ -13,7 +13,6 @@ use Drupal\node\Entity\Node;
 use Drupal\node\Entity\NodeType;
 use Drupal\taxonomy\Entity\Vocabulary;
 use Drupal\Tests\jsonapi\Functional\JsonApiFunctionalTestBase;
-use Drupal\user\Entity\Role;
 use Drupal\user\Entity\User;
 use Symfony\Component\Routing\Route;
 
@@ -125,7 +124,10 @@ class JsonApiExtrasFunctionalTest extends JsonApiFunctionalTestBase {
     static::overrideResources();
     $this->resetAll();
     $role = $this->user->get('roles')[0]->entity;
-    $this->grantPermissions($role, ['administer nodes', 'administer site configuration']);
+    $this->grantPermissions($role, [
+      'administer nodes',
+      'administer site configuration',
+    ]);
   }
 
   /**
@@ -141,7 +143,7 @@ class JsonApiExtrasFunctionalTest extends JsonApiFunctionalTestBase {
   }
 
   /**
-   *
+   * {@inheritdoc}
    */
   public function testOverwriteFieldWithOtherField() {
     $this->createDefaultContent(1, 1, FALSE, TRUE, static::IS_NOT_MULTILINGUAL);
@@ -157,6 +159,9 @@ class JsonApiExtrasFunctionalTest extends JsonApiFunctionalTestBase {
     $this->assertEquals($this->nodes[0]->field_text_moved_new->value, $output['data'][0]['attributes']['field_text_moved']['value']);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function testSortOverwrittenField() {
     $this->createDefaultContent(2, 1, FALSE, TRUE, static::IS_NOT_MULTILINGUAL);
 
@@ -187,8 +192,7 @@ class JsonApiExtrasFunctionalTest extends JsonApiFunctionalTestBase {
   /**
    * Tests that resource type fields can be aliased per resource type.
    *
-   * @see Core jsonapi module how the state code below works:
-   * Drupal\jsonapi_test_resource_type_building\EventSubscriber\ResourceTypeBuildEventSubscriber
+   * @see Drupal\jsonapi_test_resource_type_building\EventSubscriber\ResourceTypeBuildEventSubscriber
    *
    * @todo Create a test similar to this
    */
@@ -675,7 +679,7 @@ class JsonApiExtrasFunctionalTest extends JsonApiFunctionalTestBase {
     $row = $this->assertSession()->elementExists('css', sprintf('#jsonapi-disabled-resources-list table tr:contains("%s")', 'taxonomy_term--' . $vocabulary->id()));
     $this->assertSession()->elementExists('named', ['link', 'Revert'], $row);
 
-    // Add another vocabulary
+    // Add another vocabulary.
     $vocabulary2 = Vocabulary::create([
       'name' => $this->randomMachineName(),
       'vid' => mb_strtolower($this->randomMachineName()),
diff --git a/tests/src/Functional/JsonApiExtrasFunctionalTestBase.php b/tests/src/Functional/JsonApiExtrasFunctionalTestBase.php
index c4ac1d3914bca92da85071bf7763a5ac58e03d42..f1877629110bf07dbd33350652b1b9c10f979e53 100644
--- a/tests/src/Functional/JsonApiExtrasFunctionalTestBase.php
+++ b/tests/src/Functional/JsonApiExtrasFunctionalTestBase.php
@@ -6,7 +6,6 @@ use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\Tests\jsonapi\Functional\JsonApiFunctionalTestBase;
-use Drupal\user\Entity\Role;
 
 /**
  * Provides helper methods for the JSON API Extras module's functional tests.
@@ -63,7 +62,10 @@ abstract class JsonApiExtrasFunctionalTestBase extends JsonApiFunctionalTestBase
     static::overrideResources();
     $this->resetAll();
     $role = $this->user->get('roles')[0]->entity;
-    $this->grantPermissions($role, ['administer nodes', 'administer site configuration']);
+    $this->grantPermissions($role, [
+      'administer nodes',
+      'administer site configuration',
+    ]);
   }
 
   /**
diff --git a/tests/src/Kernel/Controller/EntityResourceTest.php b/tests/src/Kernel/Controller/EntityResourceTest.php
index f52ea432c4b49932ece1069ce931d639564f3442..3edc8280b1a958950461d8cf217cfeec98d9447c 100644
--- a/tests/src/Kernel/Controller/EntityResourceTest.php
+++ b/tests/src/Kernel/Controller/EntityResourceTest.php
@@ -112,7 +112,6 @@ class EntityResourceTest extends KernelTestBase {
     ]);
     $node_type->save();
 
-    $parsed_node_type = NodeType::create($values);
     Role::load(Role::ANONYMOUS_ID)
       ->grantPermission('administer content types')
       ->save();
diff --git a/tests/src/Kernel/EntityToJsonApiTest.php b/tests/src/Kernel/EntityToJsonApiTest.php
index 0774f060fe4bd196352a16795bfb0b90444c1384..5d3ea2b75c4002663caf637b2bdd1cb1bd7abb5b 100644
--- a/tests/src/Kernel/EntityToJsonApiTest.php
+++ b/tests/src/Kernel/EntityToJsonApiTest.php
@@ -53,16 +53,22 @@ class EntityToJsonApiTest extends JsonapiKernelTestBase {
   ];
 
   /**
+   * Entity type which have the entity reference field.
+   *
    * @var \Drupal\node\Entity\NodeType
    */
   private $nodeType;
 
   /**
+   * Testing vocabulary.
+   *
    * @var \Drupal\taxonomy\Entity\Vocabulary
    */
   private $vocabulary;
 
   /**
+   * The referrer entity.
+   *
    * @var \Drupal\node\Entity\Node
    */
   private $node;
@@ -103,6 +109,8 @@ class EntityToJsonApiTest extends JsonapiKernelTestBase {
   protected $file;
 
   /**
+   * The test role.
+   *
    * @var \Drupal\user\RoleInterface
    */
   protected $role;
@@ -243,15 +251,17 @@ class EntityToJsonApiTest extends JsonapiKernelTestBase {
     array_walk(
       $entities,
       function ($data) {
-        list($entity, $include_fields, $expected_includes) = $data;
+        [$entity, $include_fields, $expected_includes] = $data;
         $this->assertEntity($entity, $include_fields, $expected_includes);
       }
     );
   }
 
   /**
-   * Test if the request by jsonapi_extras.entity.to_jsonapi doesn't linger on
-   * the request stack.
+   * Test the request stack.
+   *
+   * Confirm that the request by jsonapi_extras.entity.to_jsonapi does not
+   * linger on the request stack.
    *
    * @see https://www.drupal.org/project/jsonapi_extras/issues/3135950
    * @see https://www.drupal.org/project/jsonapi_extras/issues/3124805