diff -u b/flag.module b/flag.module
--- b/flag.module
+++ b/flag.module
@@ -32,7 +32,11 @@
         if (\Drupal::service('flag')->getFlagById('bookmark')) {
           $output .= ' ' . t('Flag module automatically provides a few default views for the <em>bookmarks</em> flag. You can use these as templates by cloning these views and then customizing as desired.');
         }
-        $output .= ' ' . t('The <a href="@flag-handbook-url">Flag module handbook</a> contains extensive <a href="@customize-url">documentation on creating customized views</a> using flags.', ['@flag-handbook-url' => 'http://drupal.org/handbook/modules/flag', '@customize-url' => 'http://drupal.org/node/296954']);
+        $output .= ' ' . t('The <a href="@flag-handbook-url">Flag module handbook</a> contains extensive <a href="@customize-url">documentation on creating customized views</a> using flags.', [
+          '@flag-handbook-url' => 'http://drupal.org/handbook/modules/flag',
+          '@customize-url' => 'http://drupal.org/node/296954',
+        ],
+        );
         $output .= '</p>';
       }
 
@@ -69,9 +73,9 @@
       // Common text.
       $output  = '<p>' . t('Flags can have fields added to them. For example,
       a "Spam" flag could have a <em>Reason</em> field where a user could type
-      in why he believes the item flagged is spam. A "Bookmarks" flag could
+      in why user believes the item flagged is spam. A "Bookmarks" flag could
       have a
-      <em>Folder</em> field into which a user could arrange her bookmarks.')
+      <em>Folder</em> field into which a user could arrange user bookmarks.')
       . '</p>';
       $output .= '<p>'.t('On this page you can add fields to flags,delete them,
       and otherwise manage them.') . '</p>';
@@ -224,12 +228,12 @@
  *
  * @param \Drupal\Core\Entity\EntityInterface $entity
  *   The entity being saved.
- * @param $values
+ * @param array $values
  *   The flag entity form values.
  *
  * @see flag_form_submit()
  */
-function flag_form_save(EntityInterface $entity, $values) {
+function flag_form_save(EntityInterface $entity, array $values) {
   $flag_service = \Drupal::service('flag');
   $account = \Drupal::currentUser();
 
diff -u b/flag.tokens.inc b/flag.tokens.inc
--- b/flag.tokens.inc
+++ b/flag.tokens.inc
@@ -78,7 +78,7 @@
   ];
 
   // Add tokens for the flag count available at the node/comment/user level.
-  /** \Drupal\flag\FlagInterface[] $flags */
+  // \Drupal\flag\FlagInterface[] $flags.
   $flags = \Drupal::service('flag')->getAllFlags();
   foreach ($flags as $id => $flag) {
     $flag_entity_type_id = $flag->getFlaggableEntityTypeId();
@@ -206,7 +206,10 @@
   $global_types = $variables['global_types'];
 
   if (\Drupal::moduleHandler()->moduleExists('token')) {
-    return theme('token_tree', ['token_types' => $types, 'global_types' => $global_types]);
+    return theme('token_tree', [
+      'token_types' => $types,
+      'global_types' => $global_types,
+    ]);
   }
   else {
     return '<p><em>' . t("Note: You don't have the <a href='@token-url'>Token</a> module installed, so the list of available tokens isn't shown here. You don't have to install <a href='@token-url'>Token</a> to be able to use tokens, but if you have it installed, and enabled, you'll be able to enjoy an interactive tokens browser.", ['@token-url' => 'http://drupal.org/project/token']) . '</em></p>';
diff -u b/modules/flag_bookmark/tests/src/Kernel/FlagBookmarkInstallUninstallTest.php b/modules/flag_bookmark/tests/src/Kernel/FlagBookmarkInstallUninstallTest.php
--- b/modules/flag_bookmark/tests/src/Kernel/FlagBookmarkInstallUninstallTest.php
+++ b/modules/flag_bookmark/tests/src/Kernel/FlagBookmarkInstallUninstallTest.php
@@ -14,7 +14,7 @@
 class FlagBookmarkInstallUninstallTest extends FlagKernelTestBase {
 
   /**
-   *
+   * Test for install and uninstall.
    */
   public function testInstallUninstall() {
     // Provides configuraiton depended on by the view.
@@ -37,7 +37,7 @@
   }
 
   /**
-   *
+   * Test on install.
    */
   protected function doTestsOnInstall() {
     $this->assertEquals(['node', 'flag_bookmark'], Flag::load('bookmark')->getDependencies()['module']);
diff -u b/modules/flag_follower/tests/src/Kernel/FlagFollowerInstallUninstallTest.php b/modules/flag_follower/tests/src/Kernel/FlagFollowerInstallUninstallTest.php
--- b/modules/flag_follower/tests/src/Kernel/FlagFollowerInstallUninstallTest.php
+++ b/modules/flag_follower/tests/src/Kernel/FlagFollowerInstallUninstallTest.php
@@ -13,10 +13,15 @@
  */
 class FlagFollowerInstallUninstallTest extends FlagKernelTestBase {
 
+  /**
+   * Static modules array.
+   *
+   * @var array
+   */
   protected static $modules = ['field', 'text'];
 
   /**
-   *
+   * Test for install and uninstall.
    */
   public function testInstallUninstall() {
     // Provides configuraiton depended on by the view.
@@ -39,12 +44,18 @@
   }
 
   /**
-   *
+   * Test on install.
    */
   protected function doTestsOnInstall() {
-    $this->assertEquals(['user', 'flag_follower'], Flag::load('following')->getDependencies()['module']);
+    $this->assertEquals([
+      'user',
+      'flag_follower',
+    ], Flag::load('following')->getDependencies()['module']);
     $this->assertEquals(['flag.flag.following'], View::load('flag_followers')->getDependencies()['config']);
-    $this->assertEquals(['core.entity_view_mode.node.full', 'flag.flag.following'], View::load('flag_followers_content')->getDependencies()['config']);
+    $this->assertEquals([
+      'core.entity_view_mode.node.full',
+      'flag.flag.following',
+    ], View::load('flag_followers_content')->getDependencies()['config']);
   }
 
 }
diff -u b/src/Entity/Flagging.php b/src/Entity/Flagging.php
--- b/src/Entity/Flagging.php
+++ b/src/Entity/Flagging.php
@@ -53,9 +53,6 @@
  */
 class Flagging extends ContentEntityBase implements FlaggingInterface {
 
-  // @todo should there be a data_table annotation?
-  // @todo should the bundle entity_key annotation be "flag" not "type"?
-
   /**
    * {@inheritdoc}
    */
@@ -188,7 +185,7 @@
   }
 
   /**
-   * {@inheritdoc.
+   * {@inheritdoc}
    */
   public function postSave(EntityStorageInterface $storage, $update = TRUE) {
     parent::postSave($storage, $update);
diff -u b/src/Entity/Storage/FlaggingStorage.php b/src/Entity/Storage/FlaggingStorage.php
--- b/src/Entity/Storage/FlaggingStorage.php
+++ b/src/Entity/Storage/FlaggingStorage.php
@@ -98,7 +98,7 @@
     $this->globalFlagIdsByEntity[$entity_type_id] += $ids_to_load;
     $flag_ids_by_entity += $ids_to_load;
 
-    // Directly query the table to avoid he overhead of loading the content
+    // Directly query the table to avoid user overhead of loading the content
     // entities.
     $query = $this->database->select('flagging', 'f')
       ->fields('f', ['entity_id', 'flag_id', 'global'])
diff -u b/src/FlagService.php b/src/FlagService.php
--- b/src/FlagService.php
+++ b/src/FlagService.php
@@ -11,8 +11,10 @@
 
 /**
  * Flag service.
- *  - Handles search requests for flags and flaggings.
- *  - Performs flagging and unflaging operations.
+ *
+ * Handles search requests for flags and flaggings.
+ *
+ * Performs flagging and unflaging operations.
  */
 class FlagService implements FlagServiceInterface {
 
@@ -57,7 +59,7 @@
    */
   public function __construct(AccountInterface $current_user,
                               EntityTypeManagerInterface $entity_type_manager,
-                              $request_stack = NULL) {
+                              RequestStack $request_stack = NULL) {
     $this->currentUser = $current_user;
     $this->entityTypeManager = $entity_type_manager;
     if (!$request_stack instanceof RequestStack) {
diff -u b/src/FlagServiceProvider.php b/src/FlagServiceProvider.php
--- b/src/FlagServiceProvider.php
+++ b/src/FlagServiceProvider.php
@@ -27,7 +27,10 @@
 
     // Replace it with our definition.
     $container->setDefinition("flag.$id", $original_definition);
-    $new_definition = new Definition('Drupal\flag\Access\CsrfAccessCheck', [new Reference("flag.$id"), new Reference('current_user')]);
+    $new_definition = new Definition('Drupal\flag\Access\CsrfAccessCheck', [
+      new Reference("flag.$id"),
+      new Reference('current_user'),
+    ]);
     $new_definition->setTags($original_definition->getTags());
     $original_definition->setTags([]);
     $new_definition->setPublic(TRUE);
diff -u b/src/Permissions/FlagPermissions.php b/src/Permissions/FlagPermissions.php
--- b/src/Permissions/FlagPermissions.php
+++ b/src/Permissions/FlagPermissions.php
@@ -50,7 +50,7 @@
     $flags = $this->flagService->getAllFlags();
 
     // Provide flag and unflag permissions for each flag.
-    foreach ($flags as $flag_name => $flag) {
+    foreach ($flags as $flag) {
       $permissions += $flag->actionPermissions();
     }
 
diff -u b/src/Plugin/ActionLink/FieldEntry.php b/src/Plugin/ActionLink/FieldEntry.php
--- b/src/Plugin/ActionLink/FieldEntry.php
+++ b/src/Plugin/ActionLink/FieldEntry.php
@@ -8,7 +8,7 @@
 use Drupal\Core\Entity\EntityInterface;
 
 /**
- * Class FieldEntry.
+ * A class for field entry.
  *
  * @ActionLinkType(
  *  id = "field_entry",
diff -u b/src/Plugin/views/field/FlagViewsFlaggedField.php b/src/Plugin/views/field/FlagViewsFlaggedField.php
--- b/src/Plugin/views/field/FlagViewsFlaggedField.php
+++ b/src/Plugin/views/field/FlagViewsFlaggedField.php
@@ -18,8 +18,6 @@
  */
 class FlagViewsFlaggedField extends Boolean {
 
-  // @todo Define the FlagViewsFlaggedField::formats variable?
-
   /**
    * {@inheritdoc}
    */
only in patch2:
unchanged:
--- a/src/Access/CsrfAccessCheck.php
+++ b/src/Access/CsrfAccessCheck.php
@@ -18,11 +18,15 @@ use Symfony\Component\HttpFoundation\Request;
 class CsrfAccessCheck implements AccessInterface {
 
   /**
+   * Access check property.
+   *
    * @var \Drupal\Core\Access\CsrfAccessCheck
    */
   protected $original;
 
   /**
+   * Account interface property.
+   *
    * @var \Drupal\Core\Session\AccountInterface
    */
   protected $account;
@@ -31,6 +35,9 @@ class CsrfAccessCheck implements AccessInterface {
    * CsrfAccessCheck constructor.
    *
    * @param \Drupal\Core\Access\CsrfAccessCheck $original
+   *   OrignalCsrfAccessCheck Parameter.
+   * @param \Drupal\Core\Session\AccountInterface $account
+   *   AccountInterface Parameter.
    */
   public function __construct(OrignalCsrfAccessCheck $original, AccountInterface $account) {
     $this->original = $original;
only in patch2:
unchanged:
--- a/src/ActionLink/ActionLinkTypeBase.php
+++ b/src/ActionLink/ActionLinkTypeBase.php
@@ -136,12 +136,13 @@ abstract class ActionLinkTypeBase extends PluginBase implements ActionLinkTypePl
   /**
    * Helper method to get the next flag action the user can take.
    *
-   * @param string $action
-   *   The action, flag or unflag.
    * @param \Drupal\flag\FlagInterface $flag
    *   The flag entity.
+   * @param \Drupal\Core\Entity\EntityInterface $entity
+   *   The interface entity.
    *
    * @return string
+   *   Return string value.
    */
   protected function getAction(FlagInterface $flag, EntityInterface $entity) {
     return $flag->isFlagged($entity) ? 'unflag' : 'flag';
only in patch2:
unchanged:
--- a/src/Controller/FieldEntryFormController.php
+++ b/src/Controller/FieldEntryFormController.php
@@ -73,7 +73,7 @@ class FieldEntryFormController extends ControllerBase {
     $this->flagService->populateFlaggerDefaults($account, $session_id);
 
     $flagging = $this->entityTypeManager()->getStorage('flagging')->create([
-      'flag_id' => $flag->id(),
+      'flag_id' => $flag_id,
       'entity_type' => $flag->getFlaggableEntityTypeId(),
       'entity_id' => $entity_id,
       'uid' => $account->id(),
only in patch2:
unchanged:
--- a/src/FlagCountManagerInterface.php
+++ b/src/FlagCountManagerInterface.php
@@ -18,10 +18,10 @@ interface FlagCountManagerInterface {
    * the flag ID:
    *
    * @code
-   * array(
-   *   my_flag => 42
-   *   another_flag => 57
-   * );
+   * [
+   *   my_flag => 42,
+   *   another_flag => 57,
+   * ];
    * @endcode
    *
    * @param \Drupal\Core\Entity\EntityInterface $entity
only in patch2:
unchanged:
--- a/src/FlagInterface.php
+++ b/src/FlagInterface.php
@@ -39,9 +39,6 @@ interface FlagInterface extends ConfigEntityInterface, EntityWithPluginCollectio
    *   The flaggable entity.
    * @param \Drupal\Core\Session\AccountInterface $account
    *   (optional) The account of the user that flagged the entity.
-   * @param string $session_id
-   *   (optional) The session ID. This must be supplied if $account is the
-   *   anonymous user.
    *
    * @return bool
    *   True if the given entity is flagged, FALSE otherwise.
