diff --git a/modules/tarpit_ban/src/EventSubscriber/Ban.php b/modules/tarpit_ban/src/EventSubscriber/Ban.php
index b2f6fa6..b75fa29 100644
--- a/modules/tarpit_ban/src/EventSubscriber/Ban.php
+++ b/modules/tarpit_ban/src/EventSubscriber/Ban.php
@@ -13,16 +13,22 @@ use Symfony\Component\HttpFoundation\RequestStack;
 class Ban implements EventSubscriberInterface {
 
   /**
+   * The requestStack.
+   *
    * @var \Symfony\Component\HttpFoundation\RequestStack
    */
-  protected $request_stack;
+  protected $requestStack;
 
   /**
+   * The ipmanager.
+   *
    * @var \Drupal\ban\BanIpManager
    */
   protected $ipmanager;
 
   /**
+   * The logger.
+   *
    * @var \Drupal\Core\Logger\LoggerChannel
    */
   protected $logger;
@@ -31,7 +37,7 @@ class Ban implements EventSubscriberInterface {
    * {@inheritdoc}
    */
   public function __construct(RequestStack $request_stack, BanIpManager $ipmanager, LoggerChannel $logger) {
-    $this->request_stack = $request_stack;
+    $this->requestStack = $request_stack;
     $this->ipmanager = $ipmanager;
     $this->logger = $logger;
   }
@@ -39,8 +45,8 @@ class Ban implements EventSubscriberInterface {
   /**
    * {@inheritdoc}
    */
-  static public function getSubscribedEvents() {
-    $events['tarpit.reaction'][] = array('ban', 0);
+  public static function getSubscribedEvents() {
+    $events['tarpit.reaction'][] = ['ban', 0];
     return $events;
   }
 
diff --git a/modules/tarpit_ban/tarpit_ban.info.yml b/modules/tarpit_ban/tarpit_ban.info.yml
index 7bc07bd..5b06562 100644
--- a/modules/tarpit_ban/tarpit_ban.info.yml
+++ b/modules/tarpit_ban/tarpit_ban.info.yml
@@ -4,5 +4,5 @@ core: 8.x
 type: module
 package: "Spam control"
 dependencies:
-  - ban
-  - tarpit
+  - drupal:ban
+  - tarpit:tarpit
diff --git a/modules/tarpit_captcha/css/style.css b/modules/tarpit_captcha/css/style.css
index ab2c167..37b6b55 100644
--- a/modules/tarpit_captcha/css/style.css
+++ b/modules/tarpit_captcha/css/style.css
@@ -1,3 +1,6 @@
 details.captcha {
-    width:0;height:0;overflow:hidden;display:none;
-}
\ No newline at end of file
+  width: 0;
+  height: 0;
+  overflow: hidden;
+  display: none;
+}
diff --git a/modules/tarpit_captcha/src/Routing/RouteController.php b/modules/tarpit_captcha/src/Routing/RouteController.php
index 80f1225..7d0ca38 100644
--- a/modules/tarpit_captcha/src/Routing/RouteController.php
+++ b/modules/tarpit_captcha/src/Routing/RouteController.php
@@ -15,12 +15,12 @@ class RouteController {
   public function routes() {
     $config = \Drupal::config('tarpit.config');
 
-    $defaults = array(
+    $defaults = [
       '_controller' => '\Drupal\tarpit\Controller\PageController::main',
       '_title' => $config->get('page_title'),
-    );
+    ];
 
-    $subpath = array('/tarpit');
+    $subpath = ['/tarpit'];
     for ($i = 0; $i < $config->get('depth'); $i++) {
       $subpath[] = '{arg' . $i . '}';
       $defaults['arg' . $i] = '';
@@ -30,9 +30,9 @@ class RouteController {
     $routes['tarpit.page'] = new Route(
       $subpath,
       $defaults,
-      array(
+      [
         '_permission' => 'access content',
-      )
+      ]
     );
 
     return $routes;
diff --git a/modules/tarpit_captcha/tarpit_captcha.info.yml b/modules/tarpit_captcha/tarpit_captcha.info.yml
index 639a2d7..56f50b4 100644
--- a/modules/tarpit_captcha/tarpit_captcha.info.yml
+++ b/modules/tarpit_captcha/tarpit_captcha.info.yml
@@ -4,5 +4,5 @@ core: 8.x
 package: "Spam control"
 type: module
 dependencies:
-  - tarpit
-  - captcha
\ No newline at end of file
+  - tarpit:tarpit
+  - captcha:captcha
diff --git a/modules/tarpit_captcha/tarpit_captcha.module b/modules/tarpit_captcha/tarpit_captcha.module
index 8f8c969..3117c0c 100644
--- a/modules/tarpit_captcha/tarpit_captcha.module
+++ b/modules/tarpit_captcha/tarpit_captcha.module
@@ -2,6 +2,7 @@
 
 /**
  * @file
+ * Main module file for the tarpit captcha module.
  */
 
 /**
@@ -9,7 +10,7 @@
  */use Drupal\tarpit\Controller\PageController;
 
 /**
- *
+ * Captcha.
  */
 function tarpit_captcha_captcha($op, $captcha_type = '') {
   switch ($op) {
@@ -20,13 +21,13 @@ function tarpit_captcha_captcha($op, $captcha_type = '') {
       if ($captcha_type == 'Tarpit') {
         $markup = PageController::generateRandomTextAndLinks('/tarpit');
 
-        $captcha = array();
+        $captcha = [];
         $captcha['solution'] = '';
-        $captcha['form']['captcha_response'] = array(
+        $captcha['form']['captcha_response'] = [
           '#type' => 'item',
           '#markup' => $markup,
           '#attached' => ['library' => ['tarpit_captcha/tarpit_captcha']],
-        );
+        ];
 
         return $captcha;
       }
diff --git a/modules/tarpit_captcha/tarpit_captcha.routing.yml b/modules/tarpit_captcha/tarpit_captcha.routing.yml
index bacb436..98a3031 100644
--- a/modules/tarpit_captcha/tarpit_captcha.routing.yml
+++ b/modules/tarpit_captcha/tarpit_captcha.routing.yml
@@ -1,2 +1,2 @@
 route_callbacks:
- - '\Drupal\tarpit_captcha\Routing\RouteController::routes'
\ No newline at end of file
+ - '\Drupal\tarpit_captcha\Routing\RouteController::routes'
diff --git a/modules/tarpit_ui/src/Form/SettingsForm.php b/modules/tarpit_ui/src/Form/SettingsForm.php
index 546008c..06201b5 100644
--- a/modules/tarpit_ui/src/Form/SettingsForm.php
+++ b/modules/tarpit_ui/src/Form/SettingsForm.php
@@ -2,9 +2,12 @@
 
 namespace Drupal\tarpit_ui\Form;
 
+use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\ProxyClass\Routing\RouteBuilder;
 use Drupal\Core\Url;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Class SettingsForm.
@@ -12,6 +15,43 @@ use Drupal\Core\Url;
 class SettingsForm extends ConfigFormBase {
 
   /**
+   * Drupal\Core\ProxyClass\Routing\RouteBuilder definition.
+   *
+   * @var \Drupal\Core\ProxyClass\Routing\RouteBuilder
+   */
+  protected $routeBuilder;
+
+  /**
+   * SettingsForm constructor.
+   *
+   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
+   *   The factory for configuration objects.
+   * @param \Drupal\Core\ProxyClass\Routing\RouteBuilder $route_builder
+   *   RouteBuilder object.
+   */
+  public function __construct(ConfigFactoryInterface $config_factory,
+                              RouteBuilder $route_builder) {
+    parent::__construct($config_factory);
+    $this->routeBuilder = $route_builder;
+  }
+
+  /**
+   * Create function.
+   *
+   * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
+   *   ContainerInterface is the interface implemented by service
+   *   container classes.
+   *
+   * @return static
+   */
+  public static function create(ContainerInterface $container) {
+    return new static(
+      $container->get('config.factory'),
+      $container->get('router.builder')
+    );
+  }
+
+  /**
    * {@inheritdoc}
    */
   public function getFormId() {
@@ -24,65 +64,65 @@ class SettingsForm extends ConfigFormBase {
   public function buildForm(array $form, FormStateInterface $form_state) {
     $config = $this->config('tarpit.config');
 
-    $form['paths'] = array(
+    $form['paths'] = [
       '#type' => 'textarea',
       '#title' => 'Paths where the Tarpit is enabled',
-      '#description' => 'Path on which to enable the trap. One per line.',
+      '#description' => $this->t('Path on which to enable the trap. One per line.'),
       '#default_value' => trim(implode(PHP_EOL, $config->get('paths'))),
-    );
+    ];
 
     $url = Url::fromUri('internal:/robots.txt');
     $url->setAbsolute(TRUE);
     $response = \Drupal::service('http_client')->get($url->toString());
 
     if ($response->getStatusCode() == 200) {
-      $form['paths_documentation'] = array(
+      $form['paths_documentation'] = [
         '#type' => 'details',
-        '#description' => 'Look at the content of the robots.txt file to help you find paths.',
+        '#description' => $this->t('Look at the content of the robots.txt file to help you find paths.'),
         '#title' => 'Content of robots.txt',
         '#collapsible' => TRUE,
         '#collapsed' => TRUE,
-        'robots' => array(
+        'robots' => [
           '#type' => 'textarea',
           '#rows' => 15,
           '#default_value' => $response->getBody(),
           '#disabled' => TRUE,
-        ),
-      );
+        ],
+      ];
     }
 
-    $form['page_title'] = array(
+    $form['page_title'] = [
       '#type' => 'textfield',
       '#title' => 'Tarpits page title',
       '#default_value' => $config->get('page_title'),
-      '#description' => 'Tarpits page title.',
-    );
+      '#description' => $this->t('Tarpits page title.'),
+    ];
 
-    $form['depth'] = array(
+    $form['depth'] = [
       '#type' => 'number',
       '#title' => 'Tarpit maximum depth',
       '#min' => 1,
       '#step' => 1,
       '#default_value' => $config->get('depth'),
-    );
+    ];
 
-    $form['words'] = array(
+    $form['words'] = [
       '#type' => 'number',
       '#title' => 'Words number',
       '#min' => 1,
       '#step' => 1,
       '#default_value' => $config->get('words'),
-      '#description' => 'Number of words in the content. These are not links.',
-    );
+      '#description' => $this->t('Number of words in the content. These are not links.'),
+    ];
 
-    $form['links'] = array(
+    $form['links'] = [
       '#type' => 'number',
       '#title' => 'Links',
       '#min' => 1,
       '#step' => 1,
       '#default_value' => $config->get('links'),
-      '#description' => 'Number of links in the content.',
-    );
+      '#description' => $this->t('Number of links in the content.'),
+    ];
 
     return parent::buildForm($form, $form_state);
   }
@@ -108,7 +148,7 @@ class SettingsForm extends ConfigFormBase {
       ->save();
 
     \Drupal::cache('config')->deleteAll();
-    \Drupal::service('router.builder')->rebuild();
+    $this->routeBuilder->rebuild();
 
     parent::submitForm($form, $form_state);
   }
diff --git a/modules/tarpit_ui/tarpit_ui.info.yml b/modules/tarpit_ui/tarpit_ui.info.yml
index 2a8a743..135ce5f 100644
--- a/modules/tarpit_ui/tarpit_ui.info.yml
+++ b/modules/tarpit_ui/tarpit_ui.info.yml
@@ -5,4 +5,4 @@ package: "Spam control"
 type: module
 configure: tarpit_ui.settings
 dependencies:
-  - tarpit
+  - tarpit:tarpit
diff --git a/modules/tarpit_ui/tarpit_ui.module b/modules/tarpit_ui/tarpit_ui.module
index fca6766..c0decab 100644
--- a/modules/tarpit_ui/tarpit_ui.module
+++ b/modules/tarpit_ui/tarpit_ui.module
@@ -2,4 +2,5 @@
 
 /**
  * @file
+ * Main module file for the tarpit ui module.
  */
diff --git a/modules/tarpit_ui/tarpit_ui.routing.yml b/modules/tarpit_ui/tarpit_ui.routing.yml
index 0b1e6f0..9f41b6d 100644
--- a/modules/tarpit_ui/tarpit_ui.routing.yml
+++ b/modules/tarpit_ui/tarpit_ui.routing.yml
@@ -4,4 +4,4 @@ tarpit_ui.settings:
     _form: '\Drupal\tarpit_ui\Form\SettingsForm'
     _title: 'Tarpit configuration'
   requirements:
-    _permission: 'administer site configuration'
\ No newline at end of file
+    _permission: 'administer site configuration'
diff --git a/src/Config/ConfigOverride.php b/src/Config/ConfigOverride.php
index a761dcc..022a395 100644
--- a/src/Config/ConfigOverride.php
+++ b/src/Config/ConfigOverride.php
@@ -14,7 +14,7 @@ class ConfigOverride implements ConfigFactoryOverrideInterface {
    * {@inheritdoc}
    */
   public function loadOverrides($names) {
-    $overrides = array();
+    $overrides = [];
     if (in_array('tarpit.config', $names)) {
       $overrides['tarpit.config']['wordlist'] = drupal_get_path('module', 'tarpit') . '/assets/words.txt';
     }
diff --git a/src/Controller/PageController.php b/src/Controller/PageController.php
index c9c4090..66634f5 100644
--- a/src/Controller/PageController.php
+++ b/src/Controller/PageController.php
@@ -7,6 +7,8 @@ use Drupal\Core\Link;
 use Drupal\Core\Url;
 use Drupal\tarpit\Event\ReactionEvent;
 use Drupal\tarpit\Event\ViewEvent;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
 
 /**
  * Class PageController.
@@ -14,11 +16,43 @@ use Drupal\tarpit\Event\ViewEvent;
 class PageController extends ControllerBase {
 
   /**
+   * Event dispatcher.
+   *
+   * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
+   */
+  protected $eventDispatcher;
+
+  /**
+   * PageController constructor.
+   *
+   * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
+   *   EventDispatcherInterface definition.
+   */
+  public function __construct(EventDispatcherInterface $event_dispatcher) {
+    $this->eventDispatcher = $event_dispatcher;
+  }
+
+  /**
+   * Create function.
+   *
+   * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
+   *   ContainerInterface is the interface implemented by service
+   *   container classes.
+   *
+   * @return static
+   */
+  public static function create(ContainerInterface $container) {
+    return new static(
+      $container->get('event_dispatcher')
+    );
+  }
+
+  /**
    * Main callback.
    */
   public function main() {
     $viewEvent = new ViewEvent();
-    $event_dispatcher = \Drupal::service('event_dispatcher');
+    $event_dispatcher = $this->eventDispatcher;
     $event_dispatcher->dispatch(ViewEvent::EVENT_NAME, $viewEvent);
 
     $depth = \Drupal::config('tarpit.config')->get('depth');
@@ -26,17 +60,16 @@ class PageController extends ControllerBase {
 
     if (count($path) - 1 >= $depth) {
       $reactionEvent = new ReactionEvent();
-      $event_dispatcher = \Drupal::service('event_dispatcher');
       $event_dispatcher->dispatch(ReactionEvent::EVENT_NAME, $reactionEvent);
     }
 
-    return array(
+    return [
       '#markup' => self::generateRandomTextAndLinks(),
-    );
+    ];
   }
 
   /**
-   *
+   * Generate random text and links.
    */
   public static function generateRandomTextAndLinks($path = '') {
     if (empty($path)) {
@@ -67,9 +100,9 @@ class PageController extends ControllerBase {
     }
 
     for ($i = 0; $i < $config->get('words'); $i++) {
-      $text[] = array(
+      $text[] = [
         '#markup' => trim($f_contents[array_rand($f_contents)]),
-      );
+      ];
     }
 
     shuffle($text);
diff --git a/src/Event/ReactionEvent.php b/src/Event/ReactionEvent.php
index 637587d..9921eb0 100644
--- a/src/Event/ReactionEvent.php
+++ b/src/Event/ReactionEvent.php
@@ -5,7 +5,7 @@ namespace Drupal\tarpit\Event;
 use Symfony\Component\EventDispatcher\GenericEvent;
 
 /**
- * Class ReactionEvent
+ * Class ReactionEvent.
  */
 class ReactionEvent extends GenericEvent {
   const EVENT_NAME = 'tarpit.reaction';
diff --git a/src/Routing/RouteController.php b/src/Routing/RouteController.php
index 0506927..2632c97 100644
--- a/src/Routing/RouteController.php
+++ b/src/Routing/RouteController.php
@@ -13,16 +13,16 @@ class RouteController {
    * Main callback.
    */
   public function routes() {
-    $routes = array();
+    $routes = [];
     $config = \Drupal::config('tarpit.config');
 
     foreach ((array) $config->get('paths') as $path_index => $path) {
-      $defaults = array(
+      $defaults = [
         '_controller' => '\Drupal\tarpit\Controller\PageController::main',
         '_title' => $config->get('page_title'),
-      );
+      ];
 
-      $subpath = array($path);
+      $subpath = [$path];
       for ($i = 0; $i < $config->get('depth'); $i++) {
         $subpath[] = '{arg' . $i . '}';
         $defaults['arg' . $i] = '';
@@ -32,9 +32,9 @@ class RouteController {
       $routes['tarpit.page' . $path_index] = new Route(
         $subpath,
         $defaults,
-        array(
+        [
           '_permission' => 'access content',
-        )
+        ]
       );
     }
 
diff --git a/tarpit.info.yml b/tarpit.info.yml
index bf0c59c..96667f8 100644
--- a/tarpit.info.yml
+++ b/tarpit.info.yml
@@ -3,4 +3,4 @@ description: Tarpit will purposely block the visitor if he reaches a particular
 core: 8.x
 package: "Spam control"
 type: module
-configure: tarpit_ui.settings
\ No newline at end of file
+configure: tarpit_ui.settings
diff --git a/tarpit.module b/tarpit.module
index ed7ff22..b44d0b5 100644
--- a/tarpit.module
+++ b/tarpit.module
@@ -13,12 +13,12 @@ use Drupal\Core\Routing\RouteMatchInterface;
 function tarpit_help($route_name, RouteMatchInterface $route_match) {
   switch ($route_name) {
     case 'help.page.tarpit':
-      $output .= '<h3>' . t('About') . '</h3>';
+      $output = '<h3>' . t('About') . '</h3>';
       $output .= '<p>' . t('A tarpit automatically trap visitors or bots that reach a particular path on your site.') . '</p>';
       $output .= '<h3>' . t('How this module works?') . '</h3>';
       $output .= '<p>' . t('The module let you add paths through the administration interface.</br>When a visitor reach one of these paths (ex: /tarpit), a list of random text and links is displayed.</br>If you follow one of these links, you will arrive on the same page with random text and links, but they are different: the path of each links has one more segment at the end, example: /tarpit/lorem.</br>And the process repeat it self forever, at the end, the url can be very long.</br>Of course, the module let you configure a maximum depth of links.</br>Events (for D8) and hooks (for D7) are triggered once a user has been trapped and another one is triggered once it has crossed the depth limit, so you can react accordingly, example, you could block the ip of the visitor if he has crossed the depth limit.') . '</p>';
       $output .= '<h3>' . t('More Information') . '</h3>';
-      $output .= '<p>' . t('For more information about this module please visite the <a href="@linkm">module page</a>.', array('@linkm' => 'https://www.drupal.org/project/tarpit')) . '</p>';
+      $output .= '<p>' . t('For more information about this module please visite the <a href="@linkm">module page</a>.', ['@linkm' => 'https://www.drupal.org/project/tarpit']) . '</p>';
       return $output;
 
     default:
diff --git a/tarpit.routing.yml b/tarpit.routing.yml
index f6d597c..36807fd 100644
--- a/tarpit.routing.yml
+++ b/tarpit.routing.yml
@@ -1,2 +1,2 @@
 route_callbacks:
- - '\Drupal\tarpit\Routing\RouteController::routes'
\ No newline at end of file
+ - '\Drupal\tarpit\Routing\RouteController::routes'
diff --git a/tarpit.services.yml b/tarpit.services.yml
index 5c4cdeb..e1f5054 100644
--- a/tarpit.services.yml
+++ b/tarpit.services.yml
@@ -5,4 +5,4 @@ services:
       - {name: config.factory.override, priority: 0}
   logger.channel.tarpit:
     parent: logger.channel_base
-    arguments: ['tarpit']
\ No newline at end of file
+    arguments: ['tarpit']
