@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function compose( Review $review, array $notification ) |
| 37 | 37 | { |
| 38 | - if( empty( $this->endpoint ))return; |
|
| 38 | + if( empty($this->endpoint) )return; |
|
| 39 | 39 | $args = shortcode_atts( glsr( SlackDefaults::class )->defaults(), $notification ); |
| 40 | 40 | $this->review = $review; |
| 41 | 41 | $notification = [ |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function send() |
| 59 | 59 | { |
| 60 | - if( empty( $this->endpoint )) { |
|
| 60 | + if( empty($this->endpoint) ) { |
|
| 61 | 61 | return new WP_Error( 'slack', 'Slack notification was not sent: missing endpoint' ); |
| 62 | 62 | } |
| 63 | 63 | return wp_remote_post( $this->endpoint, [ |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | 'redirection' => 5, |
| 70 | 70 | 'sslverify' => false, |
| 71 | 71 | 'timeout' => 45, |
| 72 | - ]); |
|
| 72 | + ] ); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
@@ -77,11 +77,11 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | protected function buildAuthorField() |
| 79 | 79 | { |
| 80 | - $email = !empty( $this->review->email ) |
|
| 80 | + $email = !empty($this->review->email) |
|
| 81 | 81 | ? '<'.$this->review->email.'>' |
| 82 | 82 | : ''; |
| 83 | 83 | $author = trim( rtrim( $this->review->author ).' '.$email ); |
| 84 | - return ['value' => implode( ' - ', array_filter( [$author, $this->review->ip_address] ))]; |
|
| 84 | + return ['value' => implode( ' - ', array_filter( [$author, $this->review->ip_address] ) )]; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | protected function buildContentField() |
| 91 | 91 | { |
| 92 | - return !empty( $this->review->content ) |
|
| 92 | + return !empty($this->review->content) |
|
| 93 | 93 | ? ['value' => $this->review->content] |
| 94 | 94 | : []; |
| 95 | 95 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $this->buildContentField(), |
| 106 | 106 | $this->buildAuthorField(), |
| 107 | 107 | ]; |
| 108 | - if( !empty( $link )) { |
|
| 108 | + if( !empty($link) ) { |
|
| 109 | 109 | $fields[] = ['value' => $link]; |
| 110 | 110 | } |
| 111 | 111 | return array_filter( $fields ); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | protected function buildStarsField() |
| 118 | 118 | { |
| 119 | 119 | $solidStars = str_repeat( '★', $this->review->rating ); |
| 120 | - $emptyStars = str_repeat( '☆', max( 0, Rating::MAX_RATING - $this->review->rating )); |
|
| 120 | + $emptyStars = str_repeat( '☆', max( 0, Rating::MAX_RATING - $this->review->rating ) ); |
|
| 121 | 121 | $stars = $solidStars.$emptyStars; |
| 122 | 122 | $stars = apply_filters( 'site-reviews/slack/stars', $stars, $this->review->rating, Rating::MAX_RATING ); |
| 123 | 123 | return ['title' => $stars]; |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | */ |
| 129 | 129 | protected function buildTitleField() |
| 130 | 130 | { |
| 131 | - return !empty( $this->review->title ) |
|
| 131 | + return !empty($this->review->title) |
|
| 132 | 132 | ? ['title' => $this->review->title] |
| 133 | 133 | : []; |
| 134 | 134 | } |
@@ -35,7 +35,9 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public function compose( Review $review, array $notification ) |
| 37 | 37 | { |
| 38 | - if( empty( $this->endpoint ))return; |
|
| 38 | + if( empty( $this->endpoint )) { |
|
| 39 | + return; |
|
| 40 | + } |
|
| 39 | 41 | $args = shortcode_atts( glsr( SlackDefaults::class )->defaults(), $notification ); |
| 40 | 42 | $this->review = $review; |
| 41 | 43 | $notification = [ |