From beb1b2bf332c786ff064464ec64145e944583ffc Mon Sep 17 00:00:00 2001
From: Nejc <nejc.koporec@agiledrop.com>
Date: Fri, 30 Mar 2018 12:37:09 +0200
Subject: [PATCH] Fixed coding standards

---
 src/Access/PublishContentAccess.php                   | 14 ++++++++++++--
 src/Controller/PublishContentPublishEntity.php        |  8 ++++++++
 src/Plugin/Menu/LocalTask/PublishContentLocalTask.php |  5 +++--
 src/Plugin/views/field/PublishContentNode.php         |  6 +-----
 4 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/src/Access/PublishContentAccess.php b/src/Access/PublishContentAccess.php
index 775f6f6..86009d1 100644
--- a/src/Access/PublishContentAccess.php
+++ b/src/Access/PublishContentAccess.php
@@ -8,19 +8,28 @@ use Drupal\Core\Session\AccountInterface;
 use Drupal\node\NodeInterface;
 use Drupal\publishcontent\PublishContentPermissions as Perm;
 
+/**
+ * Defines permissions.
+ */
 class PublishContentAccess implements AccessInterface {
 
   /**
+   * AccountInterface.
+   *
    * @var AccountInterface
    */
   private $account;
 
   /**
+   * NodeInterface.
+   *
    * @var NodeInterface
    */
   private $node;
 
   /**
+   * Arguments.
+   *
    * @var array
    */
   private $arguments;
@@ -55,7 +64,8 @@ class PublishContentAccess implements AccessInterface {
   }
 
   /**
-   * Helper method to check permission of user from Drupal\publishcontent\PublishContentPermissions
+   * Helper method to check permission of user
+   * from Drupal\publishcontent\PublishContentPermissions.
    */
   public function checkPermission($permission) {
     return $this->account->hasPermission(Perm::getPermission($permission, $this->arguments));
@@ -69,7 +79,7 @@ class PublishContentAccess implements AccessInterface {
   }
 
   /**
-   * Access unpublish any content
+   * Access unpublish any content.
    */
   public function accessUnpublishAny() {
     return $this->account->hasPermission('unpublish any content');
diff --git a/src/Controller/PublishContentPublishEntity.php b/src/Controller/PublishContentPublishEntity.php
index 4631e09..6e17e97 100644
--- a/src/Controller/PublishContentPublishEntity.php
+++ b/src/Controller/PublishContentPublishEntity.php
@@ -6,13 +6,21 @@ use \Drupal\node\NodeInterface;
 use \Symfony\Component\HttpFoundation\RedirectResponse;
 use \Drupal\Core\Url;
 
+/**
+ * Toggles node status.
+ */
 class PublishContentPublishEntity {
 
   /**
    * Toggle node status.
    *
    * @param NodeInterface $node
+   *   Current node.
+   *
    * @return RedirectResponse
+   *   Returns new RedirectResponse.
+   *
+   * @throws \Drupal\Core\Entity\EntityStorageException
    */
   public function toggleEntityStatus(NodeInterface $node) {
     $node->setPublished(!$node->isPublished());
diff --git a/src/Plugin/Menu/LocalTask/PublishContentLocalTask.php b/src/Plugin/Menu/LocalTask/PublishContentLocalTask.php
index a051066..8c1df8a 100644
--- a/src/Plugin/Menu/LocalTask/PublishContentLocalTask.php
+++ b/src/Plugin/Menu/LocalTask/PublishContentLocalTask.php
@@ -6,7 +6,6 @@ use Drupal\Core\Menu\LocalTaskDefault;
 use Drupal\Core\StringTranslation\StringTranslationTrait;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\node\Entity\Node;
-use Drupal\node\NodeInterface;
 
 /**
  * Defines a local task plugin with a dynamic title.
@@ -15,7 +14,9 @@ class PublishContentLocalTask extends LocalTaskDefault {
   use StringTranslationTrait;
 
   /**
-   * @var NodeInterface $node.
+   * Current node.
+   *
+   * @var \Drupal\node\Entity\Node
    */
   protected $node;
 
diff --git a/src/Plugin/views/field/PublishContentNode.php b/src/Plugin/views/field/PublishContentNode.php
index 87aa5c3..7886784 100644
--- a/src/Plugin/views/field/PublishContentNode.php
+++ b/src/Plugin/views/field/PublishContentNode.php
@@ -1,10 +1,5 @@
 <?php
 
-/**
- * @file
- * Definition of Drupal\Publishcontent\Plugin\Views\field\PublishContentNode
- */
-
 namespace Drupal\Publishcontent\Plugin\Views\field;
 
 use Drupal\Core\Form\FormStateInterface;
@@ -54,4 +49,5 @@ class PublishContentNode extends FieldPluginBase {
 
     return $this->getRenderer()->render($link->toRenderable());
   }
+
 }
-- 
2.15.1

