@@ -2,11 +2,10 @@ discard block |
||
2 | 2 | |
3 | 3 | Loader::load('router', 'Router'); |
4 | 4 | |
5 | -class PortfolioRouter extends Router |
|
6 | -{ |
|
5 | +class PortfolioRouter extends Router |
|
6 | +{ |
|
7 | 7 | |
8 | - protected function get_redirect_array() |
|
9 | - { |
|
8 | + protected function get_redirect_array() { |
|
10 | 9 | $paths = [ |
11 | 10 | [ |
12 | 11 | 'pattern' => '@/index.(html|htm|php)$@', |
@@ -31,8 +30,7 @@ discard block |
||
31 | 30 | }, $paths); |
32 | 31 | } |
33 | 32 | |
34 | - protected function get_direct_array() |
|
35 | - { |
|
33 | + protected function get_direct_array() { |
|
36 | 34 | $paths = [ |
37 | 35 | [ |
38 | 36 | 'match' => '/', |
@@ -2,11 +2,10 @@ discard block |
||
2 | 2 | |
3 | 3 | Loader::load('router', 'Router'); |
4 | 4 | |
5 | -class BlogRouter extends Router |
|
6 | -{ |
|
5 | +class BlogRouter extends Router |
|
6 | +{ |
|
7 | 7 | |
8 | - protected function get_redirect_array() |
|
9 | - { |
|
8 | + protected function get_redirect_array() { |
|
10 | 9 | return array( |
11 | 10 | (object) array( |
12 | 11 | 'pattern' => '@^/page_([0-9]+)/$@', |
@@ -43,8 +42,7 @@ discard block |
||
43 | 42 | 'replace' => '/$1')); |
44 | 43 | } |
45 | 44 | |
46 | - protected function check_for_special_redirect($uri) |
|
47 | - { |
|
45 | + protected function check_for_special_redirect($uri) { |
|
48 | 46 | if(preg_match('@^/post_([0-9]{4}-[0-9]{2}-[0-9]{2})_([a-z0-9-]+)(/?)$@', $uri, $matches)) |
49 | 47 | { |
50 | 48 | global $container; |
@@ -59,8 +57,7 @@ discard block |
||
59 | 57 | |
60 | 58 | Loader::load('utility', 'Content'); |
61 | 59 | $uri = Content::instance('URLSafe', "/{$post['category']}/{$post['path']}/")->activate(); |
62 | - } |
|
63 | - else |
|
60 | + } else |
|
64 | 61 | { |
65 | 62 | $post_uri = URLDecode::getPiece(1); |
66 | 63 | if($post_uri !== null) |
@@ -87,8 +84,7 @@ discard block |
||
87 | 84 | return $uri; |
88 | 85 | } |
89 | 86 | |
90 | - protected function get_direct_array() |
|
91 | - { |
|
87 | + protected function get_direct_array() { |
|
92 | 88 | return array( |
93 | 89 | (object) array( |
94 | 90 | 'match' => '/', |
@@ -2,16 +2,15 @@ discard block |
||
2 | 2 | |
3 | 3 | Loader::load('controller', 'lifestream/DefaultPageController'); |
4 | 4 | |
5 | -abstract class DefaultListController extends DefaultPageController |
|
6 | -{ |
|
5 | +abstract class DefaultListController extends DefaultPageController |
|
6 | +{ |
|
7 | 7 | |
8 | 8 | protected static $POSTS_PER_PAGE = 15; |
9 | 9 | |
10 | 10 | protected $page; |
11 | 11 | protected $offset; |
12 | 12 | |
13 | - public function __construct() |
|
14 | - { |
|
13 | + public function __construct() { |
|
15 | 14 | parent::__construct(); |
16 | 15 | |
17 | 16 | $this->page = $this->get_page_number(); |
@@ -25,24 +24,21 @@ discard block |
||
25 | 24 | abstract protected function get_list_prev_link(); |
26 | 25 | abstract protected function get_total_post_count(); |
27 | 26 | |
28 | - protected function set_head_data() |
|
29 | - { |
|
27 | + protected function set_head_data() { |
|
30 | 28 | parent::set_head_data(); |
31 | 29 | |
32 | 30 | $this->set_head('next_link', $this->get_list_next_link()); |
33 | 31 | $this->set_head('previous_link', $this->get_list_prev_link()); |
34 | 32 | } |
35 | 33 | |
36 | - protected function set_body_data() |
|
37 | - { |
|
34 | + protected function set_body_data() { |
|
38 | 35 | parent::set_body_data(); |
39 | 36 | |
40 | 37 | $this->set_body('view', 'Listing'); |
41 | 38 | $this->set_body('data', $this->get_list_body_data()); |
42 | 39 | } |
43 | 40 | |
44 | - final private function get_list_body_data() |
|
45 | - { |
|
41 | + final private function get_list_body_data() { |
|
46 | 42 | return array( |
47 | 43 | 'posts' => $this->get_list_posts(), |
48 | 44 | 'type' => 'list', |
@@ -52,15 +48,15 @@ discard block |
||
52 | 48 | 'prev' => $this->get_list_prev_link())); |
53 | 49 | } |
54 | 50 | |
55 | - final private function get_list_posts() |
|
56 | - { |
|
51 | + final private function get_list_posts() { |
|
57 | 52 | $post_array = array(); |
58 | 53 | foreach($this->get_list_results() as $post) |
59 | 54 | { |
60 | 55 | $post_array[] = $this->expand_post($post, 'full'); |
61 | 56 | } |
62 | - if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') |
|
63 | - $this->eject(); |
|
57 | + if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') { |
|
58 | + $this->eject(); |
|
59 | + } |
|
64 | 60 | return $post_array; |
65 | 61 | } |
66 | 62 |
@@ -2,8 +2,8 @@ discard block |
||
2 | 2 | |
3 | 3 | Loader::load('controller', 'home/DefaultPageController'); |
4 | 4 | |
5 | -final class AboutController extends DefaultPageController |
|
6 | -{ |
|
5 | +final class AboutController extends DefaultPageController |
|
6 | +{ |
|
7 | 7 | |
8 | 8 | private static $TITLE = 'About | Jacob Emerick'; |
9 | 9 | private static $DESCRIPTION = 'Some basic information about Jacob Emerick and his past, web development, and hiking adventures'; |
@@ -17,8 +17,7 @@ discard block |
||
17 | 17 | 'web developer', |
18 | 18 | 'hiker'); |
19 | 19 | |
20 | - protected function set_head_data() |
|
21 | - { |
|
20 | + protected function set_head_data() { |
|
22 | 21 | $this->set_title(self::$TITLE); |
23 | 22 | $this->set_description(self::$DESCRIPTION); |
24 | 23 | $this->set_keywords(self::$KEYWORD_ARRAY); |
@@ -26,8 +25,7 @@ discard block |
||
26 | 25 | parent::set_head_data(); |
27 | 26 | } |
28 | 27 | |
29 | - protected function set_body_data() |
|
30 | - { |
|
28 | + protected function set_body_data() { |
|
31 | 29 | $this->set_body_view('About'); |
32 | 30 | |
33 | 31 | parent::set_body_data(); |
@@ -2,8 +2,8 @@ discard block |
||
2 | 2 | |
3 | 3 | Loader::load('controller', 'home/DefaultPageController'); |
4 | 4 | |
5 | -final class ContactController extends DefaultPageController |
|
6 | -{ |
|
5 | +final class ContactController extends DefaultPageController |
|
6 | +{ |
|
7 | 7 | |
8 | 8 | private static $TITLE = 'Contact | Jacob Emerick'; |
9 | 9 | private static $DESCRIPTION = 'Contact page to reach Jacob Emerick by email or social networks'; |
@@ -16,8 +16,7 @@ discard block |
||
16 | 16 | 'email', |
17 | 17 | 'connect'); |
18 | 18 | |
19 | - protected function set_head_data() |
|
20 | - { |
|
19 | + protected function set_head_data() { |
|
21 | 20 | $this->set_title(self::$TITLE); |
22 | 21 | $this->set_description(self::$DESCRIPTION); |
23 | 22 | $this->set_keywords(self::$KEYWORD_ARRAY); |
@@ -25,27 +24,29 @@ discard block |
||
25 | 24 | parent::set_head_data(); |
26 | 25 | } |
27 | 26 | |
28 | - protected function set_body_data() |
|
29 | - { |
|
27 | + protected function set_body_data() { |
|
30 | 28 | $this->set_body('form_container', $this->process_form()); |
31 | 29 | $this->set_body_view('Contact'); |
32 | 30 | |
33 | 31 | parent::set_body_data(); |
34 | 32 | } |
35 | 33 | |
36 | - private function process_form() |
|
37 | - { |
|
38 | - if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!') |
|
39 | - return (object) array('display' => 'normal'); |
|
34 | + private function process_form() { |
|
35 | + if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!') { |
|
36 | + return (object) array('display' => 'normal'); |
|
37 | + } |
|
40 | 38 | |
41 | 39 | Loader::load('utility', 'Validate'); |
42 | 40 | $error_result = array(); |
43 | - if(!Validate::checkRequest('post', 'name', 'string')) |
|
44 | - $error_result['name'] = 'please enter your name'; |
|
45 | - if(!Validate::checkRequest('post', 'email', 'string')) |
|
46 | - $error_result['email'] = 'please enter a valid email'; |
|
47 | - if(!Validate::checkRequest('post', 'message', 'string')) |
|
48 | - $error_result['message'] = 'please write a message'; |
|
41 | + if(!Validate::checkRequest('post', 'name', 'string')) { |
|
42 | + $error_result['name'] = 'please enter your name'; |
|
43 | + } |
|
44 | + if(!Validate::checkRequest('post', 'email', 'string')) { |
|
45 | + $error_result['email'] = 'please enter a valid email'; |
|
46 | + } |
|
47 | + if(!Validate::checkRequest('post', 'message', 'string')) { |
|
48 | + $error_result['message'] = 'please write a message'; |
|
49 | + } |
|
49 | 50 | |
50 | 51 | $values = (object) array( |
51 | 52 | 'name' => Request::getPost('name'), |
@@ -5,8 +5,8 @@ discard block |
||
5 | 5 | use Jacobemerick\CommentService\Api\DefaultApi; |
6 | 6 | use Jacobemerick\CommentService\Model\Comment; |
7 | 7 | |
8 | -class ServiceCommentRepository implements CommentRepositoryInterface |
|
9 | -{ |
|
8 | +class ServiceCommentRepository implements CommentRepositoryInterface |
|
9 | +{ |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * @var Jacobemerick\CommentService\Api\DefaultApi |
@@ -16,8 +16,7 @@ discard block |
||
16 | 16 | /** |
17 | 17 | * @param Jacobemerick\CommentService\Api\DefaultApi $api |
18 | 18 | */ |
19 | - public function __construct(DefaultApi $api) |
|
20 | - { |
|
19 | + public function __construct(DefaultApi $api) { |
|
21 | 20 | $this->api = $api; |
22 | 21 | } |
23 | 22 | |
@@ -26,8 +25,7 @@ discard block |
||
26 | 25 | * @return array |
27 | 26 | * @throws Jacobemerick\CommentService\ApiException |
28 | 27 | */ |
29 | - public function createComment(array $comment) |
|
30 | - { |
|
28 | + public function createComment(array $comment) { |
|
31 | 29 | $response = $this->api->createComment($comment); |
32 | 30 | return $this->deserializeComment($response); |
33 | 31 | } |
@@ -37,8 +35,7 @@ discard block |
||
37 | 35 | * @return array |
38 | 36 | * @throws Jacobemerick\CommentService\ApiException |
39 | 37 | */ |
40 | - public function getComment($commentId) |
|
41 | - { |
|
38 | + public function getComment($commentId) { |
|
42 | 39 | $response = $this->api->getComment($commentId); |
43 | 40 | return $this->deserializeComment($response); |
44 | 41 | } |
@@ -52,8 +49,7 @@ discard block |
||
52 | 49 | * @return array |
53 | 50 | * @throws Jacobemerick\CommentService\ApiException |
54 | 51 | */ |
55 | - public function getComments($domain = null, $path = null, $page = null, $perPage = null, $order = null) |
|
56 | - { |
|
52 | + public function getComments($domain = null, $path = null, $page = null, $perPage = null, $order = null) { |
|
57 | 53 | $response = $this->api->getComments($page, $perPage, $order, $domain, $path); |
58 | 54 | return array_map([$this, 'deserializeComment'], $response); |
59 | 55 | } |
@@ -62,8 +58,7 @@ discard block |
||
62 | 58 | * @param Jacobemerick\CommentService\Model\Comment $comment |
63 | 59 | * @return array |
64 | 60 | */ |
65 | - protected function deserializeComment(Comment $comment) |
|
66 | - { |
|
61 | + protected function deserializeComment(Comment $comment) { |
|
67 | 62 | return [ |
68 | 63 | 'id' => $comment->getId(), |
69 | 64 | 'commenter' => [ |
@@ -5,8 +5,8 @@ discard block |
||
5 | 5 | use Jacobemerick\CommentService\Api\DefaultApi; |
6 | 6 | use Jacobemerick\CommentService\Model\Commenter; |
7 | 7 | |
8 | -class ServiceCommenterRepository implements CommenterRepositoryInterface |
|
9 | -{ |
|
8 | +class ServiceCommenterRepository implements CommenterRepositoryInterface |
|
9 | +{ |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * @var Jacobemerick\CommentService\Api\DefaultApi |
@@ -16,8 +16,7 @@ discard block |
||
16 | 16 | /** |
17 | 17 | * @param Jacobemerick\CommentService\Api\DefaultApi $api |
18 | 18 | */ |
19 | - public function __construct(DefaultApi $api) |
|
20 | - { |
|
19 | + public function __construct(DefaultApi $api) { |
|
21 | 20 | $this->api = $api; |
22 | 21 | } |
23 | 22 | |
@@ -26,8 +25,7 @@ discard block |
||
26 | 25 | * @return array |
27 | 26 | * @throws Jacobemerick\CommentService\ApiException |
28 | 27 | */ |
29 | - public function createCommenter(array $commenter) |
|
30 | - { |
|
28 | + public function createCommenter(array $commenter) { |
|
31 | 29 | $response = $this->api->createCommenter($commenter); |
32 | 30 | return $this->deserializeCommenter($response); |
33 | 31 | } |
@@ -37,8 +35,7 @@ discard block |
||
37 | 35 | * @return array |
38 | 36 | * @throws Jacobemerick\CommentService\ApiException |
39 | 37 | */ |
40 | - public function getCommenter($commenterId) |
|
41 | - { |
|
38 | + public function getCommenter($commenterId) { |
|
42 | 39 | $response = $this->api->getCommenter($commenterId); |
43 | 40 | return $this->deserializeCommenter($response); |
44 | 41 | } |
@@ -49,8 +46,7 @@ discard block |
||
49 | 46 | * @return array |
50 | 47 | * @throws Jacobemerick\CommentService\ApiException |
51 | 48 | */ |
52 | - public function getCommenters($page = null, $perPage = null) |
|
53 | - { |
|
49 | + public function getCommenters($page = null, $perPage = null) { |
|
54 | 50 | $response = $this->api->getCommenters($page, $perPage); |
55 | 51 | return array_map([$this, 'deserializeCommenter'], $response); |
56 | 52 | } |
@@ -59,8 +55,7 @@ discard block |
||
59 | 55 | * @param Jacobemerick\CommentService\Model\Commenter |
60 | 56 | * @return array |
61 | 57 | */ |
62 | - protected function deserializeCommenter(Commenter $commenter) |
|
63 | - { |
|
58 | + protected function deserializeCommenter(Commenter $commenter) { |
|
64 | 59 | return [ |
65 | 60 | 'id' => $commenter->getId(), |
66 | 61 | 'name' => $commenter->getName(), |