diff --git a/config/install/react_comments.settings.yml b/config/install/react_comments.settings.yml
index c760074..17d5462 100644
--- a/config/install/react_comments.settings.yml
+++ b/config/install/react_comments.settings.yml
@@ -1,4 +1,4 @@
 allowed_tags: '<a><b><em><strong><i><p>'
 prefer_gravatar: false
 user_avatar_image_style: 'thumbnail'
-full_delete: false
\ No newline at end of file
+full_delete: false
diff --git a/js/src/build.php b/js/src/build.php
index 737b961..6bad679 100755
--- a/js/src/build.php
+++ b/js/src/build.php
@@ -1,3 +1,10 @@
+<?php
+
+/**
+ * @file
+ * File with shell commands.
+ */
+?>
 #!/usr/local/bin/php
 <?php
 
@@ -12,4 +19,4 @@ $css = explode("\n", $css)[0];
 echo "\n$js\n$css\n\n";
 
 shell_exec("mv build/static/js/{$js} ../dist/react_comments.js");
-shell_exec("mv build/static/css/{$css} ../../css/dist/react_comments.css");
\ No newline at end of file
+shell_exec("mv build/static/css/{$css} ../../css/dist/react_comments.css");
diff --git a/js/src/src/App.css b/js/src/src/App.css
index 5986095..1773beb 100644
--- a/js/src/src/App.css
+++ b/js/src/src/App.css
@@ -1,7 +1,7 @@
 .rc_react-comments {
-    font-family: sans-serif;
+  font-family: sans-serif;
 }
 
 .rc_react-comments * {
-    box-sizing: border-box;
-}
\ No newline at end of file
+  box-sizing: border-box;
+}
diff --git a/js/src/src/components/Comment.css b/js/src/src/components/Comment.css
index c916f46..7b106d1 100644
--- a/js/src/src/components/Comment.css
+++ b/js/src/src/components/Comment.css
@@ -1,137 +1,137 @@
 .rc_comment {
-    position: relative;
+  position: relative;
 }
 
 .rc_comment-container {
-    display: flex;
-    flex-direction: row;
-    justify-content: flex-start;
-    align-content: flex-start;
-    align-items: flex-start;
-    margin-bottom: 20px;
+  display: flex;
+  flex-direction: row;
+  justify-content: flex-start;
+  align-content: flex-start;
+  align-items: flex-start;
+  margin-bottom: 20px;
 }
 
 .rc_comment-container--unpublished {
-    padding: 10px;
-    border-radius: 4px;
-    color: #D8000C;
-    border: 1px solid rgba(216, 0, 12, 0.23);
-    background-color: #FFBABA;
+  padding: 10px;
+  border-radius: 4px;
+  color: #d8000c;
+  border: 1px solid rgba(216, 0, 12, 0.23);
+  background-color: #ffbaba;
 }
 
 .rc_comment-details > * {
-    margin-right: 10px;
-    font-size: 12px;
+  margin-right: 10px;
+  font-size: 12px;
 }
 
 .rc_reply-to svg {
-    height: 10px;
-    width: 14px;
-    padding-left: 3px;
-    transform: scaleX(-1);
+  height: 10px;
+  width: 14px;
+  padding-left: 3px;
+  transform: scaleX(-1);
 }
 
 .rc_vote svg {
-    height: 11px;
-    width: 14px;
-    padding-left: 3px;
-    transform: scaleX(-1);
+  height: 11px;
+  width: 14px;
+  padding-left: 3px;
+  transform: scaleX(-1);
 }
 
 .rc_vote--down svg {
-    transform: rotate(180deg);
+  transform: rotate(180deg);
 }
 
 .rc_comment-menu-wrapper {
-    float: right;
+  float: right;
 }
 
 .rc_comment-menu-toggle {
-    cursor: pointer;
-    display: none;
+  cursor: pointer;
+  display: none;
 }
 
 .rc_comment-container:hover .rc_comment-menu-toggle {
-    display: block;
+  display: block;
 }
 
 .rc_comment--edit-active:hover .rc_comment-menu-toggle {
-    display: none;
+  display: none;
 }
 
 .rc_comment-menu-toggle svg {
-    height: 11px;
-    width: 14px;
+  height: 11px;
+  width: 14px;
 }
 
 .rc_comment-menu {
-    display: none;
-    position: absolute;
-    background: white;
-    list-style: none;
-    border: 2px solid #dbdfe4;
-    top: 0;
-    right: 0;
-    padding: 0;
-    z-index: 2;
-    border-radius: 4px;
+  display: none;
+  position: absolute;
+  background: white;
+  list-style: none;
+  border: 2px solid #dbdfe4;
+  top: 0;
+  right: 0;
+  padding: 0;
+  z-index: 2;
+  border-radius: 4px;
 }
 
 .rc_comment-menu--active {
-    display: block;
+  display: block;
 }
 
 .rc_comment-menu li {
-    padding: 10px 15px;
-    cursor: pointer;
+  padding: 10px 15px;
+  cursor: pointer;
 }
 
 .rc_comment-menu li:hover {
-    background: #eee;
+  background: #eee;
 }
 
 .rc_body {
-    width: 100%;
+  width: 100%;
 }
 
 .rc_comment-text {
-    margin-bottom: 1px;
+  margin-bottom: 1px;
 }
 
 .rc_username {
-    font-weight: bold;
-    font-size: 14px;
+  font-weight: bold;
+  font-size: 14px;
 }
 
 .rc_replies {
-    margin-left: 46px;
+  margin-left: 46px;
 }
 
 .rc_reply--max-level {
-    margin-left: 0;
+  margin-left: 0;
 }
 
 .rc_actions-wrapper ul {
-    padding-left: 0;
-    margin: 0;
-    list-style: none;
-    display: flex;
-    font-size: 12px;
+  padding-left: 0;
+  margin: 0;
+  list-style: none;
+  display: flex;
+  font-size: 12px;
 }
 
 .rc_actions-wrapper li {
-    margin-right: 15px;
+  margin-right: 15px;
 }
 
 .rc_actions-wrapper button {
-    padding: 0;
-    border: none;
-    background: transparent;
-    outline: none;
-    cursor: pointer;
+  padding: 0;
+  border: none;
+  background: transparent;
+  outline: none;
+  cursor: pointer;
 }
 
 .rc_reply--active,
 .rc_edit--active {
-    color: #2e9fff;
-}
\ No newline at end of file
+  color: #2e9fff;
+}
diff --git a/js/src/src/components/CommentBox.css b/js/src/src/components/CommentBox.css
index e446771..f6be69f 100644
--- a/js/src/src/components/CommentBox.css
+++ b/js/src/src/components/CommentBox.css
@@ -1,191 +1,191 @@
 .rc_input {
-    resize: none;
+  resize: none;
 }
 
 .rc_comment-box-container {
-    display: flex;
-    margin-bottom: 10px;
+  display: flex;
+  margin-bottom: 10px;
 }
 
 .rc_is-loading .rc_input-wrapper {
-    filter: blur(2px);
+  filter: blur(2px);
 }
 
 .rc_throbber-wrapper {
-    position: relative;
+  position: relative;
 }
 
 .rc_input-outer-wrapper {
-    flex-grow: 1;
-    min-width: 120px;
+  flex-grow: 1;
+  min-width: 120px;
 }
 
 .rc_comment-box-container .ReactThrobber {
-    position: absolute;
-    top: 0;
-    left: 0;
-    right: 0;
-    bottom: 0;
-    display: flex;
-    align-items: center;
-    justify-content: center;
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  display: flex;
+  align-items: center;
+  justify-content: center;
 }
 
 .rc_comment-container .rc_is-reply {
-    margin-top: 20px;
-    margin-bottom: 0;
+  margin-top: 20px;
+  margin-bottom: 0;
 }
 
 .rc_comment-container .rc_is-edit {
-    margin-bottom: 0;
+  margin-bottom: 0;
 }
 
 .rc_input-wrapper {
-    display: flex;
-    flex-direction: column;
-    flex-grow: 1;
-    border: 2px solid #dbdfe4;
-    border-radius: 6px;
-    font-size: 16px;
-    margin: 0;
-    min-height: 80px;
-    transition: min-height 175ms linear;
+  display: flex;
+  flex-direction: column;
+  flex-grow: 1;
+  border: 2px solid #dbdfe4;
+  border-radius: 6px;
+  font-size: 16px;
+  margin: 0;
+  min-height: 80px;
+  transition: min-height 175ms linear;
 }
 
 .rc_is-open .rc_input-wrapper {
-    min-height: 100px;
-    overflow: hidden;
+  min-height: 100px;
+  overflow: hidden;
 }
 
 .rc_input-wrapper .DraftEditor-root,
 .rc_input-wrapper .DraftEditor-editorContainer {
-    flex-grow: 1;
-    display: flex;
+  flex-grow: 1;
+  display: flex;
 }
 
 .rc_input-wrapper .public-DraftEditorPlaceholder-root {
-    position: absolute;
-    padding: 10px;
-    font-size: 18px;
-    color: #7f919e;
+  position: absolute;
+  padding: 10px;
+  font-size: 18px;
+  color: #7f919e;
 }
 
 .rc_input-wrapper .DraftEditor-editorContainer {
-    position: relative;
-    padding: 10px;
+  position: relative;
+  padding: 10px;
 }
 
 .rc_input-wrapper .public-DraftEditor-content {
-    flex-grow: 1;
+  flex-grow: 1;
 }
 
 .rc_input-wrapper .rc_input-actions {
-    opacity: 0;
-    height: 0;
-    transition: all 175ms linear;
-    display: flex;
-    justify-content: flex-end;
-    overflow: hidden;
+  opacity: 0;
+  height: 0;
+  transition: all 175ms linear;
+  display: flex;
+  justify-content: flex-end;
+  overflow: hidden;
 }
 
 .rc_is-open .rc_input-actions {
-    opacity: 1;
-    height: 25px;
-    background: #eee;
-    border-top: 2px solid #dbdfe4;
-    flex-shrink: 0;
+  opacity: 1;
+  height: 25px;
+  background: #eee;
+  border-top: 2px solid #dbdfe4;
+  flex-shrink: 0;
 }
 
 .rc_is-open .rc_input-actions button {
-    border: 0;
-    height: 100%;
+  border: 0;
+  height: 100%;
 }
 
 .rc_login-button {
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    text-decoration: none;
-    padding: 5px;
-    height: 30px;
-    border: 2px solid #0A76B7;
-    background: #0A76B7;
-    border-radius: 5px;
-    flex-grow: 0;
-    color: white;
-    white-space: nowrap;
-    width: 100%;
-    min-width: 120px;
-    max-width: 200px;
-    align-self: flex-start;
-    font-size: 12px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  text-decoration: none;
+  padding: 5px;
+  height: 30px;
+  border: 2px solid #0a76b7;
+  background: #0a76b7;
+  border-radius: 5px;
+  flex-grow: 0;
+  color: white;
+  white-space: nowrap;
+  width: 100%;
+  min-width: 120px;
+  max-width: 200px;
+  align-self: flex-start;
+  font-size: 12px;
 }
 
 .rc_login-button:hover {
-    background-color: #0a81c7;
-    color: white;
+  background-color: #0a81c7;
+  color: white;
 }
 
 .rc_anon-wrapper {
-    width: 100%;
-    display: flex;
-    margin-top: 10px;
-    flex-wrap: wrap;
+  width: 100%;
+  display: flex;
+  margin-top: 10px;
+  flex-wrap: wrap;
 }
 
 .rc_anon-wrapper > div {
-    margin: 0 10px 10px 0;
+  margin: 0 10px 10px 0;
 }
 
 .rc_anon-wrapper label {
-    text-transform: uppercase;
-    font-size: 10px;
-    font-family: sans-serif;
+  text-transform: uppercase;
+  font-size: 10px;
+  font-family: sans-serif;
 }
 
 .rc_anon-form {
 }
 
 .rc_anon-form-input-wrapper {
-    display: flex;
-    flex-wrap: wrap;
-    justify-content: space-between;
+  display: flex;
+  flex-wrap: wrap;
+  justify-content: space-between;
 }
 
 .rc_anon-form input {
-    display: block;
-    border: 2px solid #dbdfe4;
-    border-radius: 4px;
-    padding: 5px;
-    width: 100%;
-    min-width: 120px;
-    max-width: 200px;
-    height: 30px;
-    margin: 0 10px 0 0;
+  display: block;
+  border: 2px solid #dbdfe4;
+  border-radius: 4px;
+  padding: 5px;
+  width: 100%;
+  min-width: 120px;
+  max-width: 200px;
+  height: 30px;
+  margin: 0 10px 0 0;
 }
 .rc_anon-form input:first-child {
-    margin-bottom: 5px;
+  margin-bottom: 5px;
 }
 
 .rc_message {
-    padding: 5px 10px;
-    margin: 2px 0 5px 0;
-    border-radius: 4px;
+  padding: 5px 10px;
+  margin: 2px 0 5px 0;
+  border-radius: 4px;
 }
 
 .rc_message-only .rc_input-wrapper,
 .rc_message-only .rc_anon-wrapper {
-    display:none;
+  display: none;
 }
 
 .rc_message-type--error {
-    color: #D8000C;
-    border: 1px solid rgba(216, 0, 12, 0.23);
-    background-color: #FFBABA;
+  color: #d8000c;
+  border: 1px solid rgba(216, 0, 12, 0.23);
+  background-color: #ffbaba;
 }
 
 .rc_message-type--success {
-    color: #0cab0c;
-    border: 1px solid rgba(0, 216, 3, 0.23);
-    background-color: #baffba;
+  color: #0cab0c;
+  border: 1px solid rgba(0, 216, 3, 0.23);
+  background-color: #baffba;
 }
diff --git a/js/src/src/components/UserPicture.css b/js/src/src/components/UserPicture.css
index dbd10a8..48451a4 100644
--- a/js/src/src/components/UserPicture.css
+++ b/js/src/src/components/UserPicture.css
@@ -15,4 +15,4 @@
 .rc_comment-box-container .rc_avatar svg {
   width: 48px;
   height: 48px;
-}
\ No newline at end of file
+}
diff --git a/js/src/src/index.css b/js/src/src/index.css
index e69de29..8b13789 100644
--- a/js/src/src/index.css
+++ b/js/src/src/index.css
@@ -0,0 +1 @@
+
diff --git a/react_comments.install b/react_comments.install
index cf3975a..c26f319 100644
--- a/react_comments.install
+++ b/react_comments.install
@@ -1,5 +1,10 @@
 <?php
 
+/**
+ * @file
+ * Install file for react_comments module.
+ */
+
 use Drupal\user\Entity\Role;
 
 /**
@@ -60,7 +65,7 @@ function react_comments_install() {
       'restful get comment',
       'restful delete comment',
       'restful patch comment',
-      'restful put comment'
+      'restful put comment',
     ],
     'anonymous' => [
       'restful get comments',
@@ -81,24 +86,26 @@ function react_comments_install() {
  * Implements hook_uninstall().
  */
 function react_comments_uninstall() {
-  // Since this module treats deleted comments as "published" (so that we can see
-  // replies, and note where in the comment tree deleted comments were) we need to
-  // set the status of all RC_STATUS_DELETED comments to 0 so that they don't show
-  // up once the module is turned off. Additionally we're choosing to change the status
-  // rather than actually delete the comments, because deleting comments in drupal will
-  // delete all replies, something that may not be immediately obvious to someone
+  // Since this module treats deleted comments as "published"
+  // (so that we can see replies, and note where in the comment tree
+  // deleted comments were) we need to set the status of all RC_STATUS_DELETED
+  // comments to 0 so that they don't show up once the module is turned off.
+  // Additionally we're choosing to change the status rather than actually
+  // delete the comments, because deleting comments in drupal will delete all
+  // replies,something that may not be immediately obvious to someone
   // uninstalling this module.
   $query = db_select('comment_field_data', 'c');
   $query->join('react_comments_status', 's', 'c.cid = s.cid');
   $query->fields('c', ['cid']);
   $query->condition('s.status', RC_COMMENT_DELETED);
-  $deleted_comments = (array) $query->execute()->fetchAllKeyed(0,0);
+  $deleted_comments = (array) $query->execute()->fetchAllKeyed(0, 0);
 
   var_dump($deleted_comments);
 
   if (!empty($deleted_comments)) {
     $result = db_update('comment_field_data')
-      // let's also set the least important field to something identifiable in case someone has regrets
+      // let's also set least important field to something
+      // identifiable in case someone has regrets.
       ->fields(['status' => 0, 'homepage' => 'react_comments_deleted'])
       ->condition('comment_field_data.cid', $deleted_comments, 'IN')
       ->execute();
@@ -108,9 +115,9 @@ function react_comments_uninstall() {
 }
 
 /**
- * Install default config
+ * Install default config.
  */
 function react_comments_update_8001() {
   // This is okay cause there hasn't been any config up to this point.
   \Drupal::service('config.installer')->installDefaultConfig('module', 'react_comments');
-}
\ No newline at end of file
+}
diff --git a/react_comments.links.menu.yml b/react_comments.links.menu.yml
index cd4a116..0c617a9 100644
--- a/react_comments.links.menu.yml
+++ b/react_comments.links.menu.yml
@@ -2,4 +2,4 @@ react_comments.admin:
   title: 'React Comments'
   description: 'Administer react comments configuration'
   parent: system.admin_config
-  route_name: react_comments.settings
\ No newline at end of file
+  route_name: react_comments.settings
diff --git a/react_comments.module b/react_comments.module
index 05bf301..11454d7 100644
--- a/react_comments.module
+++ b/react_comments.module
@@ -1,16 +1,22 @@
 <?php
 
+/**
+ * @file
+ * The module file for the  module.
+ */
+
 use Drupal\node\NodeInterface;
 use Drupal\Core\Entity\EntityInterface;
-use Drupal\react_comments\Model\Comments as CommentsModel;
-use Drupal\comment\Entity\Comment as CommentEntity;
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
 
-define('RC_COMMENT_PUBLISHED', 1);
-define('RC_COMMENT_UNPUBLISHED', 0);
-define('RC_COMMENT_FLAGGED', 2);
-define('RC_COMMENT_DELETED', 3);
+const RC_COMMENT_PUBLISHED = 1;
+const RC_COMMENT_UNPUBLISHED = 0;
+const RC_COMMENT_FLAGGED = 2;
+const RC_COMMENT_DELETED = 3;
 
+/**
+ * Implements template_preprocess_field().
+ */
 function react_comments_preprocess_field(&$vars) {
   global $base_url;
 
@@ -18,11 +24,11 @@ function react_comments_preprocess_field(&$vars) {
     $vars['#attached']['library'][] = 'react_comments/react_comments';
     $vars['config'] = json_encode([
       'status' => isset($vars['element']['#object']->comment)
-        ? $vars['element']['#object']->comment->status == CommentItemInterface::OPEN
-        : FALSE,
+      ? $vars['element']['#object']->comment->status == CommentItemInterface::OPEN
+      : FALSE,
       'entity_id' => $vars['element']['#object'] ? $vars['element']['#object']->id() : NULL,
       'origin' => $base_url,
-      'full_delete' => \Drupal::config('react_comments.settings')->get('full_delete')
+      'full_delete' => \Drupal::config('react_comments.settings')->get('full_delete'),
     ]);
   }
 }
@@ -58,7 +64,11 @@ function react_comments_theme_registry_alter(&$theme_registry) {
 function react_comments_theme($existing, $type, $theme, $path) {
   return [
     'comments' => [
-      'variables' => ['entity_id' => NULL, 'origin'    => NULL, 'is_hidden' => FALSE],
+      'variables' => [
+        'entity_id' => NULL,
+        'origin' => NULL,
+        'is_hidden' => FALSE,
+      ],
     ],
   ];
 }
diff --git a/react_comments.views.inc b/react_comments.views.inc
index 693f6a5..da92c73 100644
--- a/react_comments.views.inc
+++ b/react_comments.views.inc
@@ -1,5 +1,10 @@
 <?php
 
+/**
+ * @file
+ * Data for comments storage.
+ */
+
 /**
  * Implements hook_views_data().
  */
diff --git a/src/CommentFieldSettings.php b/src/CommentFieldSettings.php
index c0fcb27..462f3a1 100644
--- a/src/CommentFieldSettings.php
+++ b/src/CommentFieldSettings.php
@@ -5,10 +5,15 @@ namespace Drupal\react_comments;
 use Drupal\node\Entity\Node;
 
 /**
- * Provides methods to check drupal comment field settings (open/closed/hidden etc)
+ * Provides methods to check drupal comment field settings.
+ *
+ * (open/closed/hidden etc)
  */
 class CommentFieldSettings {
 
+  /**
+   * Get the comment's field.
+   */
   private static function getCommentField($nid) {
     $comment_fields = &drupal_static(__FUNCTION__);
 
@@ -18,7 +23,7 @@ class CommentFieldSettings {
       foreach ($node->getFieldDefinitions() as $field_name => $definition) {
         $field = $node->get($field_name);
         if (is_a($field, 'Drupal\comment\CommentFieldItemList')) {
-          // We're assuming there's only one comment field per node. Seems sensible...
+          // Assuming there's only one comment field per node.Seems sensible.
           $comment_fields[$nid] = $field;
           break;
         }
@@ -28,37 +33,56 @@ class CommentFieldSettings {
     return $comment_fields[$nid];
   }
 
+  /**
+   * Get status of the comment field.
+   *
+   * @param int $nid
+   *   The node ID.
+   */
   public static function getCommentFieldStatus($nid) {
-    $status = null;
+    $status = NULL;
 
     $field = self::getCommentField($nid);
     $status = $field->status;
 
     if (is_null($status)) {
       // No comment field found.
-      return false;
+      return FALSE;
     }
-    else if (($status === '1') || ($status === 1)) {
+    elseif (($status === '1') || ($status === 1)) {
       return 'closed';
     }
-    else if (($status === '2') || ($status === 2)) {
+    elseif (($status === '2') || ($status === 2)) {
       return 'open';
     }
     else {
-      // shouldn't need this as comment module handles hidden comments already
+      // shouldn't need this as comment module handles hidden comments already.
       return 'hidden';
     }
   }
 
+  /**
+   * Get comment's field settings.
+   *
+   * @param int $nid
+   *   The node ID.
+   */
   public static function getCommentFieldSettings($nid) {
     $field = self::getCommentField($nid);
 
-    return $field ? $field->getSettings() : null;
+    return $field ? $field->getSettings() : NULL;
   }
 
+  /**
+   * Get comment's field config cache tag.
+   *
+   * @param int $nid
+   *   The node ID.
+   */
   public static function getCommentFieldConfigCacheTags($nid) {
     $field = self::getCommentField($nid);
 
     return $field->getFieldDefinition()->getCacheTagsToInvalidate();
   }
+
 }
diff --git a/src/Form/ReactCommentsSettingsForm.php b/src/Form/ReactCommentsSettingsForm.php
index 8cce234..0a7d62b 100644
--- a/src/Form/ReactCommentsSettingsForm.php
+++ b/src/Form/ReactCommentsSettingsForm.php
@@ -5,36 +5,74 @@ namespace Drupal\react_comments\Form;
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Form\ConfigFormBase;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\file\Entity\File;
 use Drupal\image\Entity\ImageStyle;
+use Drupal\Core\Entity\EntityStorageInterface;
 
-class ReactCommentsSettingsForm extends ConfigFormBase  {
+/**
+ * Settings form for comment system.
+ */
+class ReactCommentsSettingsForm extends ConfigFormBase {
 
 
   const GRAVATAR_DISABLED = -1;
   const GRAVATAR_FALLBACK = 0;
   const GRAVATAR_PREFER = 1;
 
+  /**
+   * The file storage service.
+   *
+   * @var \Drupal\Core\Entity\EntityStorageInterface
+   */
+  protected $fileStorage;
+
+  /**
+   * Constructs a form object for image dialog.
+   *
+   * @param \Drupal\Core\Entity\EntityStorageInterface $file_storage
+   *   The file storage service.
+   */
+  public function __construct(EntityStorageInterface $file_storage) {
+    $this->fileStorage = $file_storage;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container) {
+    return new static(
+      $container->get('entity.manager')->getStorage('file')
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function getFormId() {
     return 'react_comments_settings';
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function getEditableConfigNames() {
     return [
       'react_comments.settings',
     ];
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function buildForm(array $form, FormStateInterface $form_state) {
 
     $form['allowed_tags'] = [
       '#type' => 'textfield',
       '#title' => $this->t('Allowed HTML Tags'),
       '#description' => $this->t('A list of html tags that will be allowed in comments.'),
-      '#default_value' => $this->config('react_comments.settings')->get('allowed_tags') ?: '<a><b><em><strong><i><p>'
+      '#default_value' => $this->config('react_comments.settings')->get('allowed_tags') ?: '<a><b><em><strong><i><p>',
     ];
 
-    $image_styles = array_map(function($el) {
+    $image_styles = array_map(function ($el) {
       return $el->get('label');
     }, ImageStyle::loadMultiple());
 
@@ -43,7 +81,7 @@ class ReactCommentsSettingsForm extends ConfigFormBase  {
       '#title' => $this->t('User Avatar Image Style'),
       '#description' => $this->t("Choose the image style that will get applied to your user avatars. We recommend creating an image style with scale and crop 100 x 100 if you don't already have one"),
       '#options' => $image_styles,
-      '#default_value' => $this->config('react_comments.settings')->get('user_avatar_image_style') ?: 'thumbnail'
+      '#default_value' => $this->config('react_comments.settings')->get('user_avatar_image_style') ?: 'thumbnail',
     ];
 
     $form['prefer_gravatar'] = [
@@ -53,7 +91,7 @@ class ReactCommentsSettingsForm extends ConfigFormBase  {
       '#options' => [
         static::GRAVATAR_DISABLED => $this->t('Disabled'),
         static::GRAVATAR_FALLBACK => $this->t('Use as a fallback'),
-        static::GRAVATAR_PREFER => $this->t('Prefer over user pictures')
+        static::GRAVATAR_PREFER => $this->t('Prefer over user pictures'),
       ],
       static::GRAVATAR_DISABLED => ['#description' => $this->t('React Comments will fully ignore Gravatar images and show only user pictures set through Drupal.')],
       static::GRAVATAR_FALLBACK => ['#description' => $this->t('React Comments will show Gravatar images only if the comment was created by a drupal user without a user picture.')],
@@ -65,24 +103,27 @@ class ReactCommentsSettingsForm extends ConfigFormBase  {
       '#title' => $this->t('Default Avatar for Anonymous users'),
       '#type' => 'managed_file',
       '#upload_location' => 'public://react_comments/',
-      '#default_value' => $this->config('react_comments.settings')->get('anon_default_avatar_fid')
+      '#default_value' => $this->config('react_comments.settings')->get('anon_default_avatar_fid'),
     ];
 
     $form['full_delete'] = [
       '#type' => 'checkbox',
       '#title' => $this->t('Fully delete comments'),
       '#description' => $this->t("If this case is checked, comments that are deleted through React Comments' UX will be fully deleted, and so will be their replies. If unchecked, the comments will be shown to users as deleted, but the replies will remain"),
-      '#default_value' => $this->config('react_comments.settings')->get('full_delete')
+      '#default_value' => $this->config('react_comments.settings')->get('full_delete'),
     ];
 
     return parent::buildForm($form, $form_state);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function validateForm(array &$form, FormStateInterface $form_state) {
     parent::validateForm($form, $form_state);
 
     if ($anon_default_avatar_fid = $form_state->getValue('anon_default_avatar_fid')) {
-      $file = File::load($anon_default_avatar_fid[0]);
+      $file = $this->fileStorage->load($anon_default_avatar_fid[0]);
 
       $errors = file_validate_is_image($file);
 
@@ -93,6 +134,9 @@ class ReactCommentsSettingsForm extends ConfigFormBase  {
 
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function submitForm(array &$form, FormStateInterface $form_state) {
     $config = $this->config('react_comments.settings');
 
@@ -109,7 +153,7 @@ class ReactCommentsSettingsForm extends ConfigFormBase  {
     }
 
     if ($anon_default_avatar_fid = $form_state->getValue('anon_default_avatar_fid')) {
-      $file = File::load($anon_default_avatar_fid[0]);
+      $file = $this->fileStorage->load($anon_default_avatar_fid[0]);
       $file->setPermanent();
       $file->save();
       $config->set('anon_default_avatar_fid', $anon_default_avatar_fid);
@@ -117,9 +161,11 @@ class ReactCommentsSettingsForm extends ConfigFormBase  {
 
     $config->save();
 
-    // Most of these configs change the way comments are displayed in some way... Unfortunately we gotta clear those caches.
+    // Most of these configs change the way comments are displayed in some way
+    // Unfortunately we gotta clear those caches.
     Cache::invalidateTags(['react_comment_list']);
 
     parent::submitForm($form, $form_state);
   }
+
 }
diff --git a/src/Model/Base.php b/src/Model/Base.php
index d169f6a..b64d4e5 100644
--- a/src/Model/Base.php
+++ b/src/Model/Base.php
@@ -2,24 +2,36 @@
 
 namespace Drupal\react_comments\Model;
 
-use \Drupal\Component\Render\HtmlEscapedText;
+use Drupal\Component\Render\HtmlEscapedText;
 
+/**
+ * Base class.
+ */
 class Base {
 
-  protected $drupal_user;
+  protected $drupalUser;
   protected $roles;
   protected $cache;
 
+  /**
+   * {@inheritdoc}
+   */
   public function __construct() {
-    $this->drupal_user = \Drupal::currentUser();
+    $this->drupalUser = \Drupal::currentUser();
     $this->cache = \Drupal::cache();
   }
 
+  /**
+   * Check admin permission.
+   */
   public function isAdmin() {
     // Only admins should be able to edit comments.
-    return $this->drupal_user->hasPermission('administer comments');
+    return $this->drupalUser->hasPermission('administer comments');
   }
 
+  /**
+   * Check plain function.
+   */
   public function checkPlain($text) {
     return (new HtmlEscapedText($text))->__toString();
   }
diff --git a/src/Model/Comment.php b/src/Model/Comment.php
index cf61e11..1ac28e2 100644
--- a/src/Model/Comment.php
+++ b/src/Model/Comment.php
@@ -4,6 +4,9 @@ namespace Drupal\react_comments\Model;
 
 use Drupal\comment\Entity\Comment as CommentEntity;
 
+/**
+ * Comment class.
+ */
 class Comment extends CommentBase {
 
   /**
@@ -12,13 +15,26 @@ class Comment extends CommentBase {
   public function load($show_unpublished = FALSE) {
     $query = \Drupal::database()->select('comment_field_data', 'c');
     $query->join('comment__comment_body', 'b', 'c.cid = b.entity_id');
-    $query->fields('c', ['uid', 'pid', 'entity_id', 'subject', 'created', 'changed', 'status', 'hostname', 'name', 'mail'])
+    $query->fields('c', [
+      'uid',
+      'pid',
+      'entity_id',
+      'subject',
+      'created',
+      'changed',
+      'status',
+      'hostname',
+      'name',
+      'mail',
+    ])
       ->fields('b', ['comment_body_value'])
       ->condition('c.cid', $this->getId());
     $record = $query->execute()
       ->fetchObject();
 
-    if (empty($record->comment_body_value)) return NULL;
+    if (empty($record->comment_body_value)) {
+      return NULL;
+    }
 
     $user = new User();
     $user->setId($record->uid)->load();
@@ -59,19 +75,19 @@ class Comment extends CommentBase {
       // @todo entity_type shouldn't be hardcoded to node
       'entity_type'    => 'node',
       'entity_id'      => $this->getEntityId(),
-      'pid'            => $this->getReplyId() ?: null,
+      'pid'            => $this->getReplyId() ?: NULL,
       'field_name'     => $this->getFieldName(),
       'uid'            => $this->getUser()->getId(),
       'comment_type'   => $this->getCommentType(),
       'subject'        => $this->getSubject(),
       'comment_body'   => [
         'value'  => $this->getComment(),
-        'format' => 'basic_html'
+        'format' => 'basic_html',
       ],
       'status'         => $this->getStatus(),
       'published'      => $this->isPublished(),
       'name'           => $this->getName(),
-      'mail'          => $this->getEmail()
+      'mail'          => $this->getEmail(),
     ]);
     $comment->save();
     $this->setId($comment->id())
@@ -84,14 +100,14 @@ class Comment extends CommentBase {
    */
   public function update() {
     // @todo consider paring this whole class way down and relying more on core Comment entity.
-    $status =  $this->getStatus();
+    $status = $this->getStatus();
     if (is_numeric($status)) {
       $comment = CommentEntity::load($this->getId());
 
-      $comment->set('pid',        $this->getReplyId() ?: null);
-      $comment->set('entity_id',  $this->getEntityId());
-      $comment->set('uid',        $this->getUser()->getId());
-      $comment->set('subject',    $this->getSubject());
+      $comment->set('pid', $this->getReplyId() ?: NULL);
+      $comment->set('entity_id', $this->getEntityId());
+      $comment->set('uid', $this->getUser()->getId());
+      $comment->set('subject', $this->getSubject());
       $this->updateCustomStatus();
       if (is_numeric($this->customStatusToDrupalStatus($this->getStatus()))) {
         $comment->set('status', $this->customStatusToDrupalStatus($this->getStatus()));
@@ -101,7 +117,7 @@ class Comment extends CommentBase {
       }
       $comment->set('comment_body', [
         'value'  => $this->getComment(),
-        'format' => 'basic_html'
+        'format' => 'basic_html',
       ]);
 
       return $comment->save();
@@ -109,22 +125,22 @@ class Comment extends CommentBase {
     return NULL;
   }
 
- /**
-  * Delete a comment.
-  */
- public function delete() {
-   $comment = CommentEntity::load($this->getId());
-   $user = $this->getUser();
-   if ( $this->isAdmin() || ($user->hasPermission('edit own comments') && ($comment->get('uid')->target_id == $user->getId())) ) {
-     if (\Drupal::config('react_comments.settings')->get('full_delete')) {
-       $comment->delete();
-     }
-     else {
-       $this->setStatus( RC_COMMENT_DELETED )->update();
-     }
-   }
-   return NULL;
- }
+  /**
+   * Delete a comment.
+   */
+  public function delete() {
+    $comment = CommentEntity::load($this->getId());
+    $user = $this->getUser();
+    if ($this->isAdmin() || ($user->hasPermission('edit own comments') && ($comment->get('uid')->target_id == $user->getId()))) {
+      if (\Drupal::config('react_comments.settings')->get('full_delete')) {
+        $comment->delete();
+      }
+      else {
+        $this->setStatus(RC_COMMENT_DELETED)->update();
+      }
+    }
+    return NULL;
+  }
 
   /**
    * Update additional comment status.
@@ -179,19 +195,23 @@ class Comment extends CommentBase {
   }
 
   /**
-   *  Convert react comments custom status into drupal published status.
-   *  Use with is_numeric to decide whether to change the drupal status.
+   * Convert react comments custom status into drupal published status.
+   *
+   * Use with is_numeric to decide whether to change the drupal status.
    */
   private function customStatusToDrupalStatus($custom_status) {
-    switch($custom_status) {
+    switch ($custom_status) {
       case RC_COMMENT_PUBLISHED:
       case RC_COMMENT_DELETED:
         return 1;
+
       case RC_COMMENT_UNPUBLISHED:
         return 0;
+
       case RC_COMMENT_FLAGGED:
       default:
-        // changing to flagged state shouldn't effect whether the comment is published or unpublished
+        // Changing to flagged state shouldn't effect whether
+        // comment is published or unpublished.
         return NULL;
     }
   }
diff --git a/src/Model/CommentBase.php b/src/Model/CommentBase.php
index 337ca2f..2782e09 100644
--- a/src/Model/CommentBase.php
+++ b/src/Model/CommentBase.php
@@ -4,162 +4,252 @@ namespace Drupal\react_comments\Model;
 
 use Drupal\Component\Utility\Unicode;
 
+/**
+ * CommentBase class.
+ */
 class CommentBase extends Base {
 
   protected $id;
-  protected $reply_id;
-  protected $entity_id;
+  protected $replyId;
+  protected $entityId;
   protected $user;
   protected $subject;
   protected $comment;
-  protected $vote_stats;
+  protected $voteStats;
   protected $replies;
-  protected $ip_address;
+  protected $IpAdsress;
   protected $status;
-  protected $created_at;
-  protected $changed_at;
+  protected $createdAt;
+  protected $changedAt;
   protected $published;
   protected $name;
   protected $email;
-  protected $field_name;
-  protected $comment_type;
+  protected $fieldName;
+  protected $commentType;
 
+  /**
+   * Set ID of comment.
+   */
   public function setId($id) {
     $this->id = $id;
     return $this;
   }
 
+  /**
+   * Get ID of comment.
+   */
   public function getId() {
     return (int) $this->id;
   }
 
+  /**
+   * Set reply ID of comment.
+   */
   public function setReplyId($id) {
-    $this->reply_id = (int) $id;
+    $this->replyId = (int) $id;
     return $this;
   }
 
+  /**
+   * Get reply ID of comment.
+   */
   public function getReplyId() {
-    return (int) $this->reply_id;
+    return (int) $this->replyId;
   }
 
+  /**
+   * Set value to entityId.
+   */
   public function setEntityId($id) {
-    $this->entity_id = $id;
+    $this->entityId = $id;
     return $this;
   }
 
+  /**
+   * Get entity ID.
+   */
   public function getEntityId() {
-    return (int) $this->entity_id;
+    return (int) $this->entityId;
   }
 
+  /**
+   * Set user variable.
+   */
   public function setUser(User $user) {
     $this->user = $user;
     return $this;
   }
 
+  /**
+   * Get user object.
+   */
   public function getUser() {
     return $this->user;
   }
 
+  /**
+   * Get name.
+   */
   public function getName() {
     return $this->name;
   }
 
+  /**
+   * Set name.
+   */
   public function setName($name) {
     $this->name = $name;
     return $this;
   }
 
+  /**
+   * Get email of user.
+   */
   public function getEmail() {
     return $this->email;
   }
 
+  /**
+   * Set email of user.
+   */
   public function setEmail($email) {
     $this->email = $email;
     return $this;
   }
 
+  /**
+   * Set subject value of comment.
+   */
   public function setSubject($subject) {
     $this->subject = $subject;
     return $this;
   }
 
+  /**
+   * Get subject value of comment.
+   */
   public function getSubject() {
     return empty($this->subject) ? Unicode::truncate($this->getComment(), 60) : $this->subject;
   }
 
+  /**
+   * Set comment value.
+   */
   public function setComment($comment) {
     $this->comment = $comment;
     return $this;
   }
 
+  /**
+   * Get comments.
+   */
   public function getComment() {
     $allowed_tags = \Drupal::config('react_comments.settings')->get('allowed_tags');
     return !empty($this->comment) ? strip_tags($this->comment, $allowed_tags) : '';
   }
 
+  /**
+   * Set reply value.
+   */
   public function setReplies(array $replies) {
     $this->replies = $replies;
     return $this;
   }
 
+  /**
+   * Get replies of a commment.
+   */
   public function getReplies() {
     return !empty($this->replies) ? $this->replies : NULL;
   }
 
+  /**
+   * Set IP address.
+   */
   public function setIpAddress($ip = NULL) {
-    $this->ip_address = $ip;
+    $this->IpAdsress = $ip;
     return $this;
   }
 
+  /**
+   * Get IP address.
+   */
   public function getIpAddress() {
-    if (empty($this->ip_address)) {
+    if (empty($this->IpAdsress)) {
       return \Drupal::request()->getClientIp();
     }
-    return $this->ip_address;
+    return $this->IpAdsress;
   }
 
+  /**
+   * Set status of comment.
+   */
   public function setStatus($status) {
     $this->status = $status;
     return $this;
   }
 
+  /**
+   * Get status of comment.
+   */
   public function getStatus() {
     return $this->status;
   }
 
+  /**
+   * Check if comment is published.
+   */
   public function isPublished() {
     return $this->published;
   }
 
+  /**
+   * Set published status of comment.
+   */
   public function setPublishedStatus($status) {
     $this->published = $status;
     return $this;
   }
 
+  /**
+   * Set created time.
+   */
   public function setCreatedAt($timestamp = NULL) {
-    $this->created_at = $timestamp;
+    $this->createdAt = $timestamp;
     return $this;
   }
 
+  /**
+   * Get created time.
+   */
   public function getCreatedAt() {
-    if (empty($this->created_at)) {
+    if (empty($this->createdAt)) {
       return time();
     }
-    return $this->created_at;
+    return $this->createdAt;
   }
 
+  /**
+   * Set changed time.
+   */
   public function setChangedAt($timestamp = NULL) {
-    $this->changed_at = $timestamp;
+    $this->changedAt = $timestamp;
     return $this;
   }
 
+  /**
+   * Get changed time.
+   */
   public function getChangedAt() {
-    if (empty($this->changed_at)) {
+    if (empty($this->changedAt)) {
       return time();
     }
-    return $this->changed_at;
+    return $this->changedAt;
   }
 
+  /**
+   * Set model values.
+   */
   public function model() {
     return [
       'id'         => $this->getId(),
@@ -172,25 +262,37 @@ class CommentBase extends Base {
       'created_at' => $this->getCreatedAt(),
       'replies'    => $this->getReplies(),
       'name'       => $this->getName(),
-      'email'      => $this->getEmail()
+      'email'      => $this->getEmail(),
     ];
   }
 
+  /**
+   * Get field name.
+   */
   public function getFieldName() {
-    return $this->field_name;
+    return $this->fieldName;
   }
 
-  public function setFieldName($field_name) {
-    $this->field_name = $field_name;
+  /**
+   * Set field name.
+   */
+  public function setFieldName($fieldName) {
+    $this->fieldName = $fieldName;
     return $this;
   }
 
+  /**
+   * Get comment type.
+   */
   public function getCommentType() {
-    return $this->comment_type;
+    return $this->commentType;
   }
 
-  public function setCommentType($comment_type) {
-    $this->comment_type = $comment_type;
+  /**
+   * Set comment type.
+   */
+  public function setCommentType($commentType) {
+    $this->commentType = $commentType;
     return $this;
   }
 
diff --git a/src/Model/Comments.php b/src/Model/Comments.php
index 63a080a..16bc62c 100644
--- a/src/Model/Comments.php
+++ b/src/Model/Comments.php
@@ -2,6 +2,9 @@
 
 namespace Drupal\react_comments\Model;
 
+/**
+ * Comments class.
+ */
 class Comments extends CommentsBase {
 
   /**
@@ -16,7 +19,8 @@ class Comments extends CommentsBase {
       ->addTag('react_comments_load_comments');
 
     if (!$show_unpublished) {
-      // if the user doesn't have the 'administer comments' permission, only load published comments
+      // If the user doesn't have the 'administer comments' permission,
+      // only load published comments.
       $query->condition('c.status', RC_COMMENT_PUBLISHED);
     }
 
@@ -28,7 +32,9 @@ class Comments extends CommentsBase {
         $thread[] = $comment->model();
       }
     }
-    if (empty($thread)) return NULL;
+    if (empty($thread)) {
+      return NULL;
+    }
     $this->setComments($thread);
     return $this;
   }
diff --git a/src/Model/CommentsBase.php b/src/Model/CommentsBase.php
index 387b873..80cf699 100644
--- a/src/Model/CommentsBase.php
+++ b/src/Model/CommentsBase.php
@@ -4,33 +4,51 @@ namespace Drupal\react_comments\Model;
 
 use Drupal\react_comments\CommentFieldSettings;
 
+/**
+ * CommentsBase class.
+ */
 class CommentsBase extends Base {
 
-  protected $entity_id;
+  protected $entityId;
   protected $comments;
 
+  /**
+   * Set entity ID.
+   */
   public function setEntityId($id) {
-    $this->entity_id = $id;
+    $this->entityId = $id;
     return $this;
   }
 
+  /**
+   * Get entity ID.
+   */
   public function getEntityId() {
-    return (int) $this->entity_id;
+    return (int) $this->entityId;
   }
 
+  /**
+   * Set comments.
+   */
   public function setComments($comments) {
     $this->comments = $comments;
     return $this;
   }
 
+  /**
+   * Get comments.
+   */
   public function getComments() {
     return $this->comments;
   }
 
+  /**
+   * Set model data values.
+   */
   public function model() {
     return [
       'comments' => $this->getComments(),
-      'settings' => CommentFieldSettings::getCommentFieldSettings($this->getEntityId())
+      'settings' => CommentFieldSettings::getCommentFieldSettings($this->getEntityId()),
     ];
   }
 
diff --git a/src/Model/Me.php b/src/Model/Me.php
index 225583b..2ee28dc 100644
--- a/src/Model/Me.php
+++ b/src/Model/Me.php
@@ -2,6 +2,9 @@
 
 namespace Drupal\react_comments\Model;
 
+/**
+ * Me class.
+ */
 class Me extends MeBase {
 
 }
diff --git a/src/Model/MeBase.php b/src/Model/MeBase.php
index 4c9c62c..7436a18 100644
--- a/src/Model/MeBase.php
+++ b/src/Model/MeBase.php
@@ -2,19 +2,31 @@
 
 namespace Drupal\react_comments\Model;
 
+/**
+ * MeBase class.
+ */
 class MeBase extends Base {
 
-  protected $current_user;
+  protected $currentUser;
 
+  /**
+   * Set current User.
+   */
   public function setCurrentUser(User $current_user) {
-    $this->current_user = $current_user;
+    $this->currentUser = $current_user;
     return $this;
   }
 
+  /**
+   * Get current User.
+   */
   public function getCurrentUser() {
-    return $this->current_user;
+    return $this->currentUser;
   }
 
+  /**
+   * Set model values.
+   */
   public function model() {
     return [
       'current_user' => $this->getCurrentUser()->model(),
diff --git a/src/Model/Request.php b/src/Model/Request.php
index 2efa1ca..bbe1ccc 100644
--- a/src/Model/Request.php
+++ b/src/Model/Request.php
@@ -2,6 +2,9 @@
 
 namespace Drupal\react_comments\Model;
 
+/**
+ * Request class.
+ */
 class Request extends RequestBase {
 
 }
diff --git a/src/Model/RequestBase.php b/src/Model/RequestBase.php
index a5b042c..ee01fec 100644
--- a/src/Model/RequestBase.php
+++ b/src/Model/RequestBase.php
@@ -2,20 +2,32 @@
 
 namespace Drupal\react_comments\Model;
 
+/**
+ * RequestBase class.
+ */
 class RequestBase {
 
   protected $request;
   protected $contents = [];
 
+  /**
+   * {@inheritdoc}
+   */
   public function __construct() {
     $this->request = \Drupal::request();
   }
 
+  /**
+   * Parses the json data.
+   */
   public function parseContentJson() {
     $this->contents = json_decode($this->request->getContent(), TRUE);
     return $this;
   }
 
+  /**
+   * Get the json value.
+   */
   public function getJsonVal($parameter) {
     return !empty($this->contents[$parameter]) ? trim($this->contents[$parameter]) : NULL;
   }
diff --git a/src/Model/Response.php b/src/Model/Response.php
index 402fdf6..7df98c1 100644
--- a/src/Model/Response.php
+++ b/src/Model/Response.php
@@ -2,6 +2,9 @@
 
 namespace Drupal\react_comments\Model;
 
+/**
+ * Response class.
+ */
 class Response extends ResponseBase {
 
 }
diff --git a/src/Model/ResponseBase.php b/src/Model/ResponseBase.php
index af1a74a..4330432 100644
--- a/src/Model/ResponseBase.php
+++ b/src/Model/ResponseBase.php
@@ -4,6 +4,9 @@ namespace Drupal\react_comments\Model;
 
 use Drupal\Core\StringTranslation\StringTranslationTrait;
 
+/**
+ * ResponseBase class.
+ */
 class ResponseBase {
 
   use StringTranslationTrait;
@@ -11,25 +14,39 @@ class ResponseBase {
   protected $data;
   protected $code;
 
-
+  /**
+   * Set data values.
+   */
   public function setData($data) {
     $this->data = $data;
     return $this;
   }
 
+  /**
+   * Get data values.
+   */
   public function getData() {
     return $this->data;
   }
 
+  /**
+   * Set code value.
+   */
   public function setCode($code) {
     $this->code = $code;
     return $this;
   }
 
+  /**
+   * Get code value.
+   */
   public function getCode() {
     return $this->code;
   }
 
+  /**
+   * Get messages.
+   */
   public function getMessage() {
     $messages = [
       'success'                => $this->t('Success'),
@@ -48,7 +65,7 @@ class ResponseBase {
       'comments_closed'        => $this->t('Comments are closed for this post'),
       'comments_hidden'        => $this->t('Comments are disabled for this post'),
       'anon_contact_required'  => $this->t('Contact info for anonymous users is required'),
-      'anon_contact_forbidden' => $this->t('Contact info for anonymous users is forbidden')
+      'anon_contact_forbidden' => $this->t('Contact info for anonymous users is forbidden'),
     ];
 
     return !empty($messages[$this->getCode()])
@@ -56,6 +73,9 @@ class ResponseBase {
       : $this->t('Unknown error occured');
   }
 
+  /**
+   * Get model value.
+   */
   public function model() {
     return [
       'code'    => $this->getCode(),
diff --git a/src/Model/User.php b/src/Model/User.php
index 9fbf24d..fb147f8 100644
--- a/src/Model/User.php
+++ b/src/Model/User.php
@@ -2,31 +2,41 @@
 
 namespace Drupal\react_comments\Model;
 
+use Drupal\field\Entity\FieldConfig;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\file\Entity\File;
 use Drupal\image\Entity\ImageStyle;
 use Drupal\user\Entity\User as DrupalUser;
 
+/**
+ * User class.
+ */
 class User extends UserBase {
 
+  /**
+   * {@inheritdoc}
+   */
   public function __construct(AccountInterface $user = NULL) {
     if ($user) {
       $this->load($user);
     }
   }
 
+  /**
+   * Loads the user.
+   */
   public function load(AccountInterface $user = NULL) {
     $user = $user ?: DrupalUser::load($this->getId());
 
     if ($user) {
-      // load the full user entity so we can access the user picture field
+      // Load the full user entity so we can access the user picture field.
       $user = DrupalUser::load($user->id());
 
-      $user_picture = null;
+      $user_picture = NULL;
 
       if ($user->isAnonymous()) {
         $user_avatar_image_style = \Drupal::config('react_comments.settings')->get('user_avatar_image_style') ?: 'thumbnail';
-        $default_anon_avatar_fid = \Drupal::config('react_comments.settings')->get('anon_default_avatar_fid') ?: null;
+        $default_anon_avatar_fid = \Drupal::config('react_comments.settings')->get('anon_default_avatar_fid') ?: NULL;
 
         if ($default_anon_avatar_fid) {
           $default_anon_avatar_file = File::load($default_anon_avatar_fid[0]);
@@ -40,7 +50,7 @@ class User extends UserBase {
         $user_picture = ImageStyle::load($user_avatar_image_style)->buildUrl($uri);
       }
 
-      if (!$user_picture && $field = \Drupal\field\Entity\FieldConfig::loadByName('user', 'user', 'user_picture')) {
+      if (!$user_picture && $field = FieldConfig::loadByName('user', 'user', 'user_picture')) {
         $default_image = $field->getSetting('default_image');
         if ($file = \Drupal::entityManager()->loadEntityByUuid('file', $default_image['uuid'])) {
           $user_picture = $file->url();
@@ -49,13 +59,16 @@ class User extends UserBase {
 
       $this
         ->setId($user->id())
-        ->setName($user->id() ? $user->getDisplayName() : null)
+        ->setName($user->id() ? $user->getDisplayName() : NULL)
         ->setEmail($user->getEmail())
         ->setThumbnail($user_picture)
         ->setPermissions($this->loadPermissions($user));
     }
   }
 
+  /**
+   * Load the user's permission.
+   */
   private function loadPermissions(AccountInterface $user) {
     $permissions = [
       'administer comments',
@@ -64,7 +77,7 @@ class User extends UserBase {
       'post comments',
       'skip comment approval',
       'edit own comments',
-      'restful put comment'
+      'restful put comment',
     ];
     foreach ($permissions as $key => $permission) {
       if (!$user->hasPermission($permission)) {
@@ -73,4 +86,5 @@ class User extends UserBase {
     }
     return $permissions;
   }
+
 }
diff --git a/src/Model/UserBase.php b/src/Model/UserBase.php
index 2810c91..504d863 100644
--- a/src/Model/UserBase.php
+++ b/src/Model/UserBase.php
@@ -4,6 +4,9 @@ namespace Drupal\react_comments\Model;
 
 use Drupal\react_comments\Form\ReactCommentsSettingsForm;
 
+/**
+ * UserBase class.
+ */
 class UserBase extends Base {
 
   protected $id;
@@ -12,38 +15,62 @@ class UserBase extends Base {
   protected $thumbnail;
   protected $permissions;
 
+  /**
+   * Set user ID.
+   */
   public function setId($id) {
     $this->id = $id;
     return $this;
   }
 
+  /**
+   * Get user ID.
+   */
   public function getId() {
     return (int) $this->id;
   }
 
+  /**
+   * Set user name.
+   */
   public function setName($name) {
     $this->name = $name;
     return $this;
   }
 
+  /**
+   * Get user name.
+   */
   public function getName() {
     return $this->checkPlain($this->name);
   }
 
+  /**
+   * Set user email.
+   */
   public function setEmail($email) {
     $this->email = $email;
     return $this;
   }
 
+  /**
+   * Get user email.
+   */
   public function getEmail() {
     return $this->checkPlain($this->email);
   }
 
+  /**
+   * Get IP addess.
+   */
   public function getIpAddress() {
     // @todo dependency injection
     return \Drupal::request()->getClientIp();
   }
 
+  /**
+   * Set thumbnail.
+   */
   public function setThumbnail($url) {
     $gravatar = \Drupal::config('react_comments.settings')->get('prefer_gravatar');
 
@@ -57,23 +84,38 @@ class UserBase extends Base {
     return $this;
   }
 
+  /**
+   * Get thumbnail.
+   */
   public function getThumbnail() {
     return $this->thumbnail;
   }
 
+  /**
+   * Get user permissions.
+   */
   public function getPermissions() {
     return $this->permissions;
   }
 
+  /**
+   * Set user permissions.
+   */
   public function setPermissions($permissions) {
     $this->permissions = $permissions;
     return $this;
   }
 
+  /**
+   * Check user permissions.
+   */
   public function hasPermission($permission) {
     return in_array($permission, $this->permissions);
   }
 
+  /**
+   * Get model value.
+   */
   public function model() {
     return [
       'id'            => $this->getId(),
@@ -81,30 +123,40 @@ class UserBase extends Base {
       'thumbnail'     => $this->getThumbnail(),
       'email'         => $this->getEmail(),
       'isAnon'        => ($this->getId() === 0),
-      'permissions'   => $this->getPermissions()
+      'permissions'   => $this->getPermissions(),
     ];
   }
 
   /**
-   * Get either a Gravatar URL or complete image tag for a specified email address.
+   * Get either a Gravatar URL or complete image tag for email address.
+   *
+   * @param string $email
+   *   The email address.
+   * @param string $s
+   *   Size in pixels, defaults to 80px [ 1 - 2048 ].
+   * @param string $d
+   *   Default imageset to use [ 404 | mm | identicon | monsterid | wavatar ].
+   * @param string $r
+   *   Maximum rating (inclusive) [ g | pg | r | x ].
+   * @param bool $img
+   *   True to return a complete IMG tag False for just the URL.
+   * @param array $atts
+   *   Optional, additional key/value attributes to include in the IMG tag.
+   *
+   * @return string
+   *   Containing either just a URL or a complete image tag
    *
-   * @param string $email The email address
-   * @param string $s Size in pixels, defaults to 80px [ 1 - 2048 ]
-   * @param string $d Default imageset to use [ 404 | mm | identicon | monsterid | wavatar ]
-   * @param string $r Maximum rating (inclusive) [ g | pg | r | x ]
-   * @param boole $img True to return a complete IMG tag False for just the URL
-   * @param array $atts Optional, additional key/value attributes to include in the IMG tag
-   * @return String containing either just a URL or a complete image tag
    * @source https://gravatar.com/site/implement/images/php/
    */
-  protected function getGravatar( $email, $s = 80, $d = 'mm', $r = 'g', $img = FALSE, $atts = [] ) {
+  protected function getGravatar($email, $s = 80, $d = 'mm', $r = 'g', $img = FALSE, array $atts = []) {
     $url = 'https://www.gravatar.com/avatar/';
-    $url .= md5( strtolower( trim( $email ) ) );
+    $url .= md5(strtolower(trim($email)));
     $url .= "?s=$s&amp;d=$d&amp;r=$r";
-    if ( $img ) {
+    if ($img) {
       $url = '<img src="' . $url . '"';
-      foreach ( $atts as $key => $val )
+      foreach ($atts as $key => $val) {
         $url .= ' ' . $key . '="' . $val . '"';
+      }
       $url .= ' />';
     }
     return $url;
diff --git a/src/Plugin/rest/resource/Comment.php b/src/Plugin/rest/resource/Comment.php
index 49b614b..c786339 100644
--- a/src/Plugin/rest/resource/Comment.php
+++ b/src/Plugin/rest/resource/Comment.php
@@ -52,7 +52,7 @@ class Comment extends ResourceBase {
           case 'flag':
             if ($comment->load()) {
               if ($comment->getStatus() != RC_COMMENT_FLAGGED) {
-                $comment->setStatus( RC_COMMENT_FLAGGED )->update();
+                $comment->setStatus(RC_COMMENT_FLAGGED)->update();
                 $response->setData($comment->model())
                   ->setCode('success');
               }
@@ -62,9 +62,12 @@ class Comment extends ResourceBase {
               }
             }
             break;
+
           case 'publish':
           case 'unpublish':
-            if (!$current_user->hasPermission('administer comments')) break;
+            if (!$current_user->hasPermission('administer comments')) {
+              break;
+            }
 
             if ($comment->load()) {
               $op = ($op === 'publish') ? RC_COMMENT_PUBLISHED : RC_COMMENT_UNPUBLISHED;
@@ -104,11 +107,11 @@ class Comment extends ResourceBase {
           $response->setCode('comments_closed');
           return new JsonResponse($response->model(), 403);
         }
-        else if (($current_user->id() !== (string) $comment->getUser()->getId()) && !$current_user->hasPermission('administer comments')) {
+        elseif (($current_user->id() !== (string) $comment->getUser()->getId()) && !$current_user->hasPermission('administer comments')) {
           $response->setCode('not_authorized');
           return new JsonResponse($response->model(), 403);
         }
-        else if ($comment->getStatus() !== 0 || $current_user->hasPermission('administer comments')) {
+        elseif ($comment->getStatus() !== 0 || $current_user->hasPermission('administer comments')) {
           $comment_body = $request->getJsonVal('comment');
           $comment->setComment($comment_body)->update();
           $response->setData($comment->model())
@@ -145,7 +148,7 @@ class Comment extends ResourceBase {
             $response->setCode('comments_closed');
             return new JsonResponse($response->model(), 403);
           }
-          else if (!$full_delete && $item->getStatus() == RC_COMMENT_DELETED) {
+          elseif (!$full_delete && $item->getStatus() == RC_COMMENT_DELETED) {
             $response->setCode('already_deleted');
           }
           else {
diff --git a/src/Plugin/rest/resource/Comments.php b/src/Plugin/rest/resource/Comments.php
index 8d29fbc..6c37259 100644
--- a/src/Plugin/rest/resource/Comments.php
+++ b/src/Plugin/rest/resource/Comments.php
@@ -30,6 +30,9 @@ use Drupal\react_comments\Model\Request as RequestModel;
  */
 class Comments extends ResourceBase {
 
+  /**
+   * GET method for the rest api.
+   */
   public function get($entity_id = NULL) {
     $response = new ResponseModel();
 
@@ -39,7 +42,7 @@ class Comments extends ResourceBase {
     if (empty($entity_id)) {
       $response->setCode('invalid_nid');
     }
-    else if (CommentFieldSettings::getCommentFieldStatus($entity_id) === 'hidden') {
+    elseif (CommentFieldSettings::getCommentFieldStatus($entity_id) === 'hidden') {
       $response->setCode('comments_hidden');
       $res = (new ResourceResponse($response->model(), 403));
       if ($node) {
@@ -47,7 +50,7 @@ class Comments extends ResourceBase {
       }
       return $res;
     }
-    else if (!$node) {
+    elseif (!$node) {
       $response->setCode('nid_not_found');
     }
     else {
@@ -67,7 +70,9 @@ class Comments extends ResourceBase {
     $res = (new ResourceResponse($response->model()));
     $res->getCacheableMetadata()->addCacheContexts(['user.permissions']);
 
-    // Since we're exposing field config settings (to determine whether or not anons should leave contact info) we need to add the appropriate cache tags.
+    // Since we're exposing field config settings
+    // (to determine whether or not anons should leave contact info)
+    // we need to add the appropriate cache tags.
     $res->getCacheableMetadata()->addCacheTags(CommentFieldSettings::getCommentFieldConfigCacheTags($entity_id));
 
     $res->getCacheableMetadata()->addCacheTags(['react_comment_list']);
@@ -78,6 +83,9 @@ class Comments extends ResourceBase {
     return $res;
   }
 
+  /**
+   * POST method of the rest api.
+   */
   public function post($entity_id = NULL) {
     $response = new ResponseModel();
     $drupal_user = \Drupal::currentUser();
@@ -86,7 +94,7 @@ class Comments extends ResourceBase {
       $response->setCode('invalid_nid');
       return (new JsonResponse($response->model(), 404));
     }
-    else if ((CommentFieldSettings::getCommentFieldStatus($entity_id) === 'closed') && !$drupal_user->hasPermission('administer comments')) {
+    elseif ((CommentFieldSettings::getCommentFieldStatus($entity_id) === 'closed') && !$drupal_user->hasPermission('administer comments')) {
       $response->setCode('comments_closed');
       return (new JsonResponse($response->model(), 403));
     }
@@ -105,21 +113,21 @@ class Comments extends ResourceBase {
         $skip_approval = $drupal_user->hasPermission('skip comment approval');
 
         if ($skip_approval) {
-          $comment->setStatus( RC_COMMENT_PUBLISHED );
+          $comment->setStatus(RC_COMMENT_PUBLISHED);
         }
         else {
-          $comment->setStatus( RC_COMMENT_UNPUBLISHED );
+          $comment->setStatus(RC_COMMENT_UNPUBLISHED);
         }
 
         if ($current_user->getId() === 0) {
           $comment_field_settings = CommentFieldSettings::getCommentFieldSettings($entity_id);
 
-          // These two cases should never happen
+          // These two cases should never happen.
           if (isset($comment_field_settings['anonymous']) && $comment_field_settings['anonymous'] === CommentInterface::ANONYMOUS_MUST_CONTACT && empty($request->getJsonVal('anon_email'))) {
             $response->setCode('anon_contact_required');
             return (new JsonResponse($response->model(), 400));
           }
-          else if (isset($comment_field_settings['anonymous']) && $comment_field_settings['anonymous'] === CommentInterface::ANONYMOUS_MAYNOT_CONTACT && !empty($request->getJsonVal('anon_email'))) {
+          elseif (isset($comment_field_settings['anonymous']) && $comment_field_settings['anonymous'] === CommentInterface::ANONYMOUS_MAYNOT_CONTACT && !empty($request->getJsonVal('anon_email'))) {
             $response->setCode('anon_contact_forbidden');
             return (new JsonResponse($response->model(), 400));
           }
@@ -156,31 +164,34 @@ class Comments extends ResourceBase {
     return (new JsonResponse($response->model()));
   }
 
+  /**
+   * Get comment field name and type.
+   */
   private function getCommentFieldNameAndType($node) {
-    // Get the comment field name and type using in the current node
+    // Get the comment field name and type using in the current node.
     $comment_field_name = 'comment';
     $comment_type = 'comment';
 
     $field_definitions = $node->getFieldDefinitions();
 
     foreach ($field_definitions as $definition) {
-      // Get field definitions of a comment field
+      // Get field definitions of a comment field.
       if ($definition instanceof FieldConfig) {
         $type = $definition->get('field_type');
 
         if (isset($type) && $type === 'comment') {
-          // Get comment field name from field definitions
+          // Get comment field name from field definitions.
           $comment_field_name_value = $definition->get('field_name');
-          // Make sure this value is not null
+          // Make sure this value is not null.
           if (isset($comment_field_name)) {
             $comment_field_name = $comment_field_name_value;
           }
 
-          // Get comment field type from field storage definitions
+          // Get comment field type from field storage definitions.
           $fsd = $definition->getFieldStorageDefinition();
           if (isset($fsd)) {
             $comment_type_value = $fsd->getSetting('comment_type');
-            // Make sure this value is not null
+            // Make sure this value is not null.
             if (isset($comment_type_value)) {
               $comment_type = $comment_type_value;
             }
@@ -192,7 +203,8 @@ class Comments extends ResourceBase {
 
     return [
       'name' => $comment_field_name,
-      'type' => $comment_type
+      'type' => $comment_type,
     ];
   }
+
 }
diff --git a/src/Plugin/rest/resource/Me.php b/src/Plugin/rest/resource/Me.php
index 92e1e12..f07d589 100644
--- a/src/Plugin/rest/resource/Me.php
+++ b/src/Plugin/rest/resource/Me.php
@@ -22,6 +22,9 @@ use Drupal\rest\ResourceResponse;
  */
 class Me extends ResourceBase {
 
+  /**
+   * GET method of the rest api.
+   */
   public function get() {
     // @todo dependency injection
     $current_user = \Drupal::currentUser();
diff --git a/src/Plugin/views/field/ReactCommentsStatus.php b/src/Plugin/views/field/ReactCommentsStatus.php
index f647a89..703f793 100644
--- a/src/Plugin/views/field/ReactCommentsStatus.php
+++ b/src/Plugin/views/field/ReactCommentsStatus.php
@@ -9,7 +9,7 @@ use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 
 /**
- * React Comment status
+ * React Comment status.
  *
  * @ViewsField("react_comment_status")
  */
@@ -48,6 +48,9 @@ class ReactCommentsStatus extends FieldPluginBase {
     return $this->getStatusLabel($value);
   }
 
+  /**
+   * Get the status label.
+   */
   protected function getStatusLabel($value) {
     if ($value == RC_COMMENT_PUBLISHED) {
       return $this->t('Published');
diff --git a/src/Plugin/views/filter/ReactCommentsStatus.php b/src/Plugin/views/filter/ReactCommentsStatus.php
index ca6d02b..2a004b3 100644
--- a/src/Plugin/views/filter/ReactCommentsStatus.php
+++ b/src/Plugin/views/filter/ReactCommentsStatus.php
@@ -12,6 +12,9 @@ use Drupal\views\Plugin\views\filter\NumericFilter;
  */
 class ReactCommentsStatus extends NumericFilter {
 
+  /**
+   * Get the status of the comment filter.
+   */
   public function query() {
     $this->ensureMyTable();
     if ($this->value != 'All') {
@@ -24,6 +27,9 @@ class ReactCommentsStatus extends NumericFilter {
     }
   }
 
+  /**
+   * Add condition for group in field.
+   */
   protected function opSimple($field) {
     if ($this->value['value'] != 'All') {
       $this->query->addWhere($this->options['group'], $field, $this->value['value'], $this->operator);
@@ -42,6 +48,9 @@ class ReactCommentsStatus extends NumericFilter {
     ];
   }
 
+  /**
+   * Get comment status.
+   */
   protected function getStatues() {
     return [
       RC_COMMENT_PUBLISHED   => $this->t('Published'),
