@@ -7,22 +7,22 @@ discard block |
||
7 | 7 | |
8 | 8 | use Jacobemerick\Web\Domain\Comment\Comment\ServiceCommentRepository; |
9 | 9 | |
10 | -class CommentSubmitModule |
|
11 | -{ |
|
10 | +class CommentSubmitModule |
|
11 | +{ |
|
12 | 12 | |
13 | 13 | private $site; |
14 | 14 | private $path; |
15 | 15 | private $fullPath; |
16 | 16 | |
17 | - public function __construct($site, $path, $fullPath, $pageTitle) |
|
18 | - { |
|
17 | + public function __construct($site, $path, $fullPath, $pageTitle) |
|
18 | + { |
|
19 | 19 | $this->site = $site; |
20 | 20 | $this->path = $path; |
21 | 21 | $this->fullPath = $fullPath; |
22 | 22 | } |
23 | 23 | |
24 | - public function activate() |
|
25 | - { |
|
24 | + public function activate() |
|
25 | + { |
|
26 | 26 | // todo why is this responsible for checking on valid calls |
27 | 27 | if (!Request::hasPost()) { |
28 | 28 | return false; |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | $this->redirectToComment($commentId); |
45 | 45 | } |
46 | 46 | |
47 | - private function checkValidation() |
|
48 | - { |
|
47 | + private function checkValidation() |
|
48 | + { |
|
49 | 49 | $errors = array(); |
50 | 50 | if (!Validate::checkRequest('post', 'name', 'name')) { |
51 | 51 | $errors['name'] = 'You must include a valid name'; |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | return $errors; |
70 | 70 | } |
71 | 71 | |
72 | - private function save(array $data) |
|
73 | - { |
|
72 | + private function save(array $data) |
|
73 | + { |
|
74 | 74 | $path = $_SERVER['REQUEST_URI']; |
75 | 75 | $path = explode('/', $path); |
76 | 76 | $path = array_filter($path); |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | return $response['id']; |
108 | 108 | } |
109 | 109 | |
110 | - private function redirectToComment($commentId) |
|
111 | - { |
|
110 | + private function redirectToComment($commentId) |
|
111 | + { |
|
112 | 112 | $url = ''; |
113 | 113 | $url .= $this->fullPath; |
114 | 114 | $url .= "#comment-{$commentId}"; |
@@ -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' => [ |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | { |
24 | 24 | parent::__construct(); |
25 | 25 | |
26 | - $this->add_js('https://maps.googleapis.com/maps/api/js?key=' . self::$API_KEY . '&sensor=false'); |
|
26 | + $this->add_js('https://maps.googleapis.com/maps/api/js?key='.self::$API_KEY.'&sensor=false'); |
|
27 | 27 | $this->add_waterfall_js(); |
28 | 28 | } |
29 | 29 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | { |
32 | 32 | parent::set_head_data(); |
33 | 33 | |
34 | - $this->set_title(self::$TITLE . ' | ' . self::$WEBSITE_TITLE); |
|
34 | + $this->set_title(self::$TITLE.' | '.self::$WEBSITE_TITLE); |
|
35 | 35 | $this->set_description(self::$DESCRIPTION); |
36 | 36 | $this->set_keywords(self::$KEYWORD_ARRAY); |
37 | 37 | } |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | Loader::load('controller', 'waterfalls/DefaultPageController'); |
4 | 4 | Loader::load('collector', 'waterfall/WaterfallCollector'); |
5 | 5 | |
6 | -final class MapController extends DefaultPageController |
|
7 | -{ |
|
6 | +final class MapController extends DefaultPageController |
|
7 | +{ |
|
8 | 8 | |
9 | 9 | private static $TITLE = 'Map of Upper Peninsula Waterfalls'; |
10 | 10 | private static $DESCRIPTION = ''; |
@@ -19,16 +19,16 @@ discard block |
||
19 | 19 | 'Upper Tahquamenon Falls', |
20 | 20 | ); |
21 | 21 | |
22 | - public function __construct() |
|
23 | - { |
|
22 | + public function __construct() |
|
23 | + { |
|
24 | 24 | parent::__construct(); |
25 | 25 | |
26 | 26 | $this->add_js('https://maps.googleapis.com/maps/api/js?key=' . self::$API_KEY . '&sensor=false'); |
27 | 27 | $this->add_waterfall_js(); |
28 | 28 | } |
29 | 29 | |
30 | - protected function set_head_data() |
|
31 | - { |
|
30 | + protected function set_head_data() |
|
31 | + { |
|
32 | 32 | parent::set_head_data(); |
33 | 33 | |
34 | 34 | $this->set_title(self::$TITLE . ' | ' . self::$WEBSITE_TITLE); |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | $this->set_keywords(self::$KEYWORD_ARRAY); |
37 | 37 | } |
38 | 38 | |
39 | - protected function set_body_data($page_type = 'wide') |
|
40 | - { |
|
39 | + protected function set_body_data($page_type = 'wide') |
|
40 | + { |
|
41 | 41 | parent::set_body_data($page_type); |
42 | 42 | |
43 | 43 | $this->set_head('full_page_map', true); |
@@ -45,15 +45,15 @@ discard block |
||
45 | 45 | $this->set_body('view', 'Map'); |
46 | 46 | } |
47 | 47 | |
48 | - private function fetch_waterfall_list() |
|
49 | - { |
|
48 | + private function fetch_waterfall_list() |
|
49 | + { |
|
50 | 50 | $list = WaterfallCollector::getMapList(); |
51 | 51 | array_walk($list, array($this, 'parse_waterfall')); |
52 | 52 | return $list; |
53 | 53 | } |
54 | 54 | |
55 | - private function parse_waterfall(&$waterfall) |
|
56 | - { |
|
55 | + private function parse_waterfall(&$waterfall) |
|
56 | + { |
|
57 | 57 | $waterfall = (object) array( |
58 | 58 | 'name' => $waterfall->name, |
59 | 59 | 'latitude' => $waterfall->latitude, |