Passed
Push — feature/rebusify ( 639d49...fe0687 )
by Paul
04:51
created
plugin/Controllers/RebusifyController.php 2 patches
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -8,71 +8,71 @@
 block discarded – undo
8 8
 
9 9
 class RebusifyController extends Controller
10 10
 {
11
-    /**
12
-     * Triggered when a review is created
13
-     * @return void
14
-     * @action site-reviews/review/created
15
-     */
16
-    public function onCreated(Review $review)
17
-    {
18
-        if ($this->canProceed($review) && 'publish' === $review->status) {
19
-            $result = glsr(Rebusify::class)->sendReview($review);
20
-            // @todo
21
-        }
22
-    }
11
+	/**
12
+	 * Triggered when a review is created
13
+	 * @return void
14
+	 * @action site-reviews/review/created
15
+	 */
16
+	public function onCreated(Review $review)
17
+	{
18
+		if ($this->canProceed($review) && 'publish' === $review->status) {
19
+			$result = glsr(Rebusify::class)->sendReview($review);
20
+			// @todo
21
+		}
22
+	}
23 23
 
24
-    /**
25
-     * Triggered when a review is reverted to its original title/content/date_timestamp
26
-     * @return void
27
-     * @action site-reviews/review/reverted
28
-     */
29
-    public function onReverted(Review $review)
30
-    {
31
-        if ($this->canProceed($review) && 'publish' === $review->status) {
32
-            $result = glsr(Rebusify::class)->sendReview($review);
33
-            // @todo
34
-        }
35
-    }
24
+	/**
25
+	 * Triggered when a review is reverted to its original title/content/date_timestamp
26
+	 * @return void
27
+	 * @action site-reviews/review/reverted
28
+	 */
29
+	public function onReverted(Review $review)
30
+	{
31
+		if ($this->canProceed($review) && 'publish' === $review->status) {
32
+			$result = glsr(Rebusify::class)->sendReview($review);
33
+			// @todo
34
+		}
35
+	}
36 36
 
37
-    /**
38
-     * Triggered when an existing review is updated
39
-     * @return void
40
-     * @action site-reviews/review/saved
41
-     */
42
-    public function onSaved(Review $review)
43
-    {
44
-        if ($this->canProceed($review) && 'publish' === $review->status) {
45
-            $result = glsr(Rebusify::class)->sendReview($review);
46
-            // @todo
47
-        }
48
-    }
37
+	/**
38
+	 * Triggered when an existing review is updated
39
+	 * @return void
40
+	 * @action site-reviews/review/saved
41
+	 */
42
+	public function onSaved(Review $review)
43
+	{
44
+		if ($this->canProceed($review) && 'publish' === $review->status) {
45
+			$result = glsr(Rebusify::class)->sendReview($review);
46
+			// @todo
47
+		}
48
+	}
49 49
 
50
-    /**
51
-     * Triggered when a review's response is added or updated
52
-     * @param int $metaId
53
-     * @param int $postId
54
-     * @param string $metaKey
55
-     * @param mixed $metaValue
56
-     * @return void
57
-     * @action updated_postmeta
58
-     */
59
-    public function onUpdatedMeta($metaId, $postId, $metaKey, $metaValue)
60
-    {
61
-        if (!$this->isReviewPostId($postId) 
62
-            || !$this->canProceed($review) 
63
-            || '_response' !== $metaKey) {
64
-            return;
65
-        }
66
-        $review = glsr_get_review($postId);
67
-        $result = glsr(Rebusify::class)->sendReviewResponse($review);
68
-        // @todo
69
-    }
50
+	/**
51
+	 * Triggered when a review's response is added or updated
52
+	 * @param int $metaId
53
+	 * @param int $postId
54
+	 * @param string $metaKey
55
+	 * @param mixed $metaValue
56
+	 * @return void
57
+	 * @action updated_postmeta
58
+	 */
59
+	public function onUpdatedMeta($metaId, $postId, $metaKey, $metaValue)
60
+	{
61
+		if (!$this->isReviewPostId($postId) 
62
+			|| !$this->canProceed($review) 
63
+			|| '_response' !== $metaKey) {
64
+			return;
65
+		}
66
+		$review = glsr_get_review($postId);
67
+		$result = glsr(Rebusify::class)->sendReviewResponse($review);
68
+		// @todo
69
+	}
70 70
 
71
-    /**
72
-     * @return bool
73
-     */
74
-    protected function canProceed(Review $review)
75
-    {
76
-        return glsr(OptionManager::class)->getBool('settings.general.support.rebusify');
77
-    }
71
+	/**
72
+	 * @return bool
73
+	 */
74
+	protected function canProceed(Review $review)
75
+	{
76
+		return glsr(OptionManager::class)->getBool('settings.general.support.rebusify');
77
+	}
78 78
 }
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -13,10 +13,10 @@  discard block
 block discarded – undo
13 13
      * @return void
14 14
      * @action site-reviews/review/created
15 15
      */
16
-    public function onCreated(Review $review)
16
+    public function onCreated( Review $review )
17 17
     {
18
-        if ($this->canProceed($review) && 'publish' === $review->status) {
19
-            $result = glsr(Rebusify::class)->sendReview($review);
18
+        if( $this->canProceed( $review ) && 'publish' === $review->status ) {
19
+            $result = glsr( Rebusify::class )->sendReview( $review );
20 20
             // @todo
21 21
         }
22 22
     }
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
      * @return void
27 27
      * @action site-reviews/review/reverted
28 28
      */
29
-    public function onReverted(Review $review)
29
+    public function onReverted( Review $review )
30 30
     {
31
-        if ($this->canProceed($review) && 'publish' === $review->status) {
32
-            $result = glsr(Rebusify::class)->sendReview($review);
31
+        if( $this->canProceed( $review ) && 'publish' === $review->status ) {
32
+            $result = glsr( Rebusify::class )->sendReview( $review );
33 33
             // @todo
34 34
         }
35 35
     }
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
      * @return void
40 40
      * @action site-reviews/review/saved
41 41
      */
42
-    public function onSaved(Review $review)
42
+    public function onSaved( Review $review )
43 43
     {
44
-        if ($this->canProceed($review) && 'publish' === $review->status) {
45
-            $result = glsr(Rebusify::class)->sendReview($review);
44
+        if( $this->canProceed( $review ) && 'publish' === $review->status ) {
45
+            $result = glsr( Rebusify::class )->sendReview( $review );
46 46
             // @todo
47 47
         }
48 48
     }
@@ -56,23 +56,23 @@  discard block
 block discarded – undo
56 56
      * @return void
57 57
      * @action updated_postmeta
58 58
      */
59
-    public function onUpdatedMeta($metaId, $postId, $metaKey, $metaValue)
59
+    public function onUpdatedMeta( $metaId, $postId, $metaKey, $metaValue )
60 60
     {
61
-        if (!$this->isReviewPostId($postId) 
62
-            || !$this->canProceed($review) 
63
-            || '_response' !== $metaKey) {
61
+        if( !$this->isReviewPostId( $postId ) 
62
+            || !$this->canProceed( $review ) 
63
+            || '_response' !== $metaKey ) {
64 64
             return;
65 65
         }
66
-        $review = glsr_get_review($postId);
67
-        $result = glsr(Rebusify::class)->sendReviewResponse($review);
66
+        $review = glsr_get_review( $postId );
67
+        $result = glsr( Rebusify::class )->sendReviewResponse( $review );
68 68
         // @todo
69 69
     }
70 70
 
71 71
     /**
72 72
      * @return bool
73 73
      */
74
-    protected function canProceed(Review $review)
74
+    protected function canProceed( Review $review )
75 75
     {
76
-        return glsr(OptionManager::class)->getBool('settings.general.support.rebusify');
76
+        return glsr( OptionManager::class )->getBool( 'settings.general.support.rebusify' );
77 77
     }
78 78
 }
Please login to merge, or discard this patch.