@@ -116,6 +116,9 @@ |
||
| 116 | 116 | return $response['id']; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | + /** |
|
| 120 | + * @param string $commentId |
|
| 121 | + */ |
|
| 119 | 122 | private function redirectToComment($commentId) |
| 120 | 123 | { |
| 121 | 124 | $url = ''; |
@@ -6,8 +6,8 @@ discard block |
||
| 6 | 6 | use Jacobemerick\CommentService\Api\DefaultApi; |
| 7 | 7 | use Jacobemerick\CommentService\Model\Comment; |
| 8 | 8 | |
| 9 | -class ServiceCommentRepository implements CommentRepositoryInterface |
|
| 10 | -{ |
|
| 9 | +class ServiceCommentRepository implements CommentRepositoryInterface |
|
| 10 | +{
|
|
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * @var DefaultApi |
@@ -17,8 +17,8 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * @param DefaultApi $api |
| 19 | 19 | */ |
| 20 | - public function __construct(DefaultApi $api) |
|
| 21 | - { |
|
| 20 | + public function __construct(DefaultApi $api) |
|
| 21 | + {
|
|
| 22 | 22 | $this->api = $api; |
| 23 | 23 | } |
| 24 | 24 | |
@@ -27,8 +27,8 @@ discard block |
||
| 27 | 27 | * @return array |
| 28 | 28 | * @throws ApiException |
| 29 | 29 | */ |
| 30 | - public function createComment(array $comment) |
|
| 31 | - { |
|
| 30 | + public function createComment(array $comment) |
|
| 31 | + {
|
|
| 32 | 32 | $response = $this->api->createComment($comment); |
| 33 | 33 | return $this->deserializeComment($response); |
| 34 | 34 | } |
@@ -38,8 +38,8 @@ discard block |
||
| 38 | 38 | * @return array |
| 39 | 39 | * @throws ApiException |
| 40 | 40 | */ |
| 41 | - public function getComment($commentId) |
|
| 42 | - { |
|
| 41 | + public function getComment($commentId) |
|
| 42 | + {
|
|
| 43 | 43 | $response = $this->api->getComment($commentId); |
| 44 | 44 | return $this->deserializeComment($response); |
| 45 | 45 | } |
@@ -53,8 +53,8 @@ discard block |
||
| 53 | 53 | * @return array |
| 54 | 54 | * @throws ApiException |
| 55 | 55 | */ |
| 56 | - public function getComments($domain = null, $path = null, $page = null, $perPage = null, $order = null) |
|
| 57 | - { |
|
| 56 | + public function getComments($domain = null, $path = null, $page = null, $perPage = null, $order = null) |
|
| 57 | + {
|
|
| 58 | 58 | $response = (array) $this->api->getComments($page, $perPage, $order, $domain, $path); |
| 59 | 59 | return array_map([$this, 'deserializeComment'], $response); |
| 60 | 60 | } |
@@ -63,8 +63,8 @@ discard block |
||
| 63 | 63 | * @param Comment $comment |
| 64 | 64 | * @return array |
| 65 | 65 | */ |
| 66 | - protected function deserializeComment(Comment $comment) |
|
| 67 | - { |
|
| 66 | + protected function deserializeComment(Comment $comment) |
|
| 67 | + {
|
|
| 68 | 68 | return [ |
| 69 | 69 | 'id' => $comment->getId(), |
| 70 | 70 | 'commenter' => [ |