@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | parent::set_head_data(); |
| 46 | 46 | |
| 47 | - if($this->page == 1) |
|
| 47 | + if ($this->page == 1) |
|
| 48 | 48 | { |
| 49 | 49 | $this->set_title(sprintf(self::$TITLE_MAIN, ucwords($this->query))); |
| 50 | 50 | $this->set_description(sprintf(self::$DESCRIPTION_MAIN, ucwords($this->query))); |
@@ -62,10 +62,10 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | protected function get_introduction() |
| 64 | 64 | { |
| 65 | - if($this->total_pages > 1) |
|
| 65 | + if ($this->total_pages > 1) |
|
| 66 | 66 | return array( |
| 67 | 67 | 'title' => "Posts from search '{$this->query}', page {$this->page} of {$this->total_pages}."); |
| 68 | - else if($this->total_pages == 1) |
|
| 68 | + else if ($this->total_pages == 1) |
|
| 69 | 69 | return array( |
| 70 | 70 | 'title' => "Posts from search '{$this->query}'."); |
| 71 | 71 | else |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | protected function get_page_number() |
| 77 | 77 | { |
| 78 | 78 | $page = URLDecode::getPiece(3); |
| 79 | - if(isset($page) && is_numeric($page)) |
|
| 79 | + if (isset($page) && is_numeric($page)) |
|
| 80 | 80 | return $page; |
| 81 | 81 | return 1; |
| 82 | 82 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | private $search_result; |
| 85 | 85 | private function get_search_result() |
| 86 | 86 | { |
| 87 | - if(!isset($this->search_result)) |
|
| 87 | + if (!isset($this->search_result)) |
|
| 88 | 88 | { |
| 89 | 89 | global $container; |
| 90 | 90 | $repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']); |
@@ -114,24 +114,24 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | protected function get_list_next_link() |
| 116 | 116 | { |
| 117 | - if($this->page == 1) |
|
| 117 | + if ($this->page == 1) |
|
| 118 | 118 | return; |
| 119 | - if($this->page == 2) |
|
| 119 | + if ($this->page == 2) |
|
| 120 | 120 | return Content::instance('URLSafe', "/search/{$this->query}/")->activate(); |
| 121 | - return Content::instance('URLSafe', "/search/{$this->query}/" . ($this->page - 1) . '/')->activate(); |
|
| 121 | + return Content::instance('URLSafe', "/search/{$this->query}/".($this->page - 1).'/')->activate(); |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | protected function get_list_prev_link() |
| 125 | 125 | { |
| 126 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
| 126 | + if (($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
| 127 | 127 | return; |
| 128 | - return Content::instance('URLSafe', "/search/{$this->query}/" . ($this->page + 1) . '/')->activate(); |
|
| 128 | + return Content::instance('URLSafe', "/search/{$this->query}/".($this->page + 1).'/')->activate(); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | private $total_post_count; |
| 132 | 132 | protected function get_total_post_count() |
| 133 | 133 | { |
| 134 | - if(!isset($this->total_post_count)) |
|
| 134 | + if (!isset($this->total_post_count)) |
|
| 135 | 135 | $this->total_post_count = count($this->get_search_result()); |
| 136 | 136 | return $this->total_post_count; |
| 137 | 137 | } |
@@ -6,134 +6,134 @@ |
||
| 6 | 6 | final class SearchController extends DefaultListController |
| 7 | 7 | { |
| 8 | 8 | |
| 9 | - private static $TITLE_MAIN = "%s Search | Jacob Emerick's Blog"; |
|
| 10 | - private static $DESCRIPTION_MAIN = "Posts containing the phrase %s on Jacob Emerick's Blog."; |
|
| 11 | - |
|
| 12 | - private static $TITLE_PAGINATED = "%s Search - Page %d of %d | Jacob Emerick's Blog"; |
|
| 13 | - private static $DESCRIPTION_PAGINATED = "Page %d of %d with posts containing the phrase %s on Jacob Emerick's Blog."; |
|
| 14 | - |
|
| 15 | - private static $KEYWORD_ARRAY = array( |
|
| 16 | - 'hiking', |
|
| 17 | - 'web development', |
|
| 18 | - 'blog', |
|
| 19 | - 'Jacob Emerick'); |
|
| 20 | - |
|
| 21 | - private static $LIST_DESCRIPTION = 'Viewing %d - %d of %d posts containing the phrase %s.'; |
|
| 22 | - private static $SEARCH_WEIGHTS = array( |
|
| 23 | - array( |
|
| 24 | - 'field' => 'title', |
|
| 25 | - 'weight' => 8), |
|
| 26 | - array( |
|
| 27 | - 'field' => 'body', |
|
| 28 | - 'weight' => 4)); |
|
| 29 | - |
|
| 30 | - private $query; |
|
| 31 | - |
|
| 32 | - public function __construct() |
|
| 33 | - { |
|
| 34 | - $query = URLDecode::getPiece(2); |
|
| 35 | - $query = urldecode($query); |
|
| 9 | + private static $TITLE_MAIN = "%s Search | Jacob Emerick's Blog"; |
|
| 10 | + private static $DESCRIPTION_MAIN = "Posts containing the phrase %s on Jacob Emerick's Blog."; |
|
| 11 | + |
|
| 12 | + private static $TITLE_PAGINATED = "%s Search - Page %d of %d | Jacob Emerick's Blog"; |
|
| 13 | + private static $DESCRIPTION_PAGINATED = "Page %d of %d with posts containing the phrase %s on Jacob Emerick's Blog."; |
|
| 14 | + |
|
| 15 | + private static $KEYWORD_ARRAY = array( |
|
| 16 | + 'hiking', |
|
| 17 | + 'web development', |
|
| 18 | + 'blog', |
|
| 19 | + 'Jacob Emerick'); |
|
| 20 | + |
|
| 21 | + private static $LIST_DESCRIPTION = 'Viewing %d - %d of %d posts containing the phrase %s.'; |
|
| 22 | + private static $SEARCH_WEIGHTS = array( |
|
| 23 | + array( |
|
| 24 | + 'field' => 'title', |
|
| 25 | + 'weight' => 8), |
|
| 26 | + array( |
|
| 27 | + 'field' => 'body', |
|
| 28 | + 'weight' => 4)); |
|
| 29 | + |
|
| 30 | + private $query; |
|
| 31 | + |
|
| 32 | + public function __construct() |
|
| 33 | + { |
|
| 34 | + $query = URLDecode::getPiece(2); |
|
| 35 | + $query = urldecode($query); |
|
| 36 | 36 | $query = str_replace('-', ' ', $query); |
| 37 | 37 | |
| 38 | - $this->query = $query; |
|
| 38 | + $this->query = $query; |
|
| 39 | 39 | |
| 40 | - parent::__construct(); |
|
| 41 | - } |
|
| 40 | + parent::__construct(); |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - protected function set_head_data() |
|
| 44 | - { |
|
| 45 | - parent::set_head_data(); |
|
| 43 | + protected function set_head_data() |
|
| 44 | + { |
|
| 45 | + parent::set_head_data(); |
|
| 46 | 46 | |
| 47 | - if($this->page == 1) |
|
| 48 | - { |
|
| 49 | - $this->set_title(sprintf(self::$TITLE_MAIN, ucwords($this->query))); |
|
| 50 | - $this->set_description(sprintf(self::$DESCRIPTION_MAIN, ucwords($this->query))); |
|
| 51 | - } |
|
| 52 | - else |
|
| 53 | - { |
|
| 54 | - $this->set_title(sprintf(self::$TITLE_PAGINATED, ucwords($this->query), $this->page, $this->total_pages)); |
|
| 55 | - $this->set_description(sprintf(self::$DESCRIPTION_PAGINATED, $this->page, $this->total_pages, ucwords($this->query))); |
|
| 56 | - } |
|
| 47 | + if($this->page == 1) |
|
| 48 | + { |
|
| 49 | + $this->set_title(sprintf(self::$TITLE_MAIN, ucwords($this->query))); |
|
| 50 | + $this->set_description(sprintf(self::$DESCRIPTION_MAIN, ucwords($this->query))); |
|
| 51 | + } |
|
| 52 | + else |
|
| 53 | + { |
|
| 54 | + $this->set_title(sprintf(self::$TITLE_PAGINATED, ucwords($this->query), $this->page, $this->total_pages)); |
|
| 55 | + $this->set_description(sprintf(self::$DESCRIPTION_PAGINATED, $this->page, $this->total_pages, ucwords($this->query))); |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - $keyword_array = self::$KEYWORD_ARRAY; |
|
| 59 | - array_unshift($keyword_array, $this->query); |
|
| 60 | - $this->set_keywords($keyword_array); |
|
| 61 | - } |
|
| 62 | - |
|
| 63 | - protected function get_introduction() |
|
| 64 | - { |
|
| 65 | - if($this->total_pages > 1) |
|
| 66 | - return array( |
|
| 67 | - 'title' => "Posts from search '{$this->query}', page {$this->page} of {$this->total_pages}."); |
|
| 68 | - else if($this->total_pages == 1) |
|
| 69 | - return array( |
|
| 70 | - 'title' => "Posts from search '{$this->query}'."); |
|
| 71 | - else |
|
| 72 | - return array( |
|
| 73 | - 'title' => "Sorry, '{$this->query}' didn't return any posts."); |
|
| 74 | - } |
|
| 75 | - |
|
| 76 | - protected function get_page_number() |
|
| 77 | - { |
|
| 78 | - $page = URLDecode::getPiece(3); |
|
| 79 | - if(isset($page) && is_numeric($page)) |
|
| 80 | - return $page; |
|
| 81 | - return 1; |
|
| 82 | - } |
|
| 83 | - |
|
| 84 | - private $search_result; |
|
| 85 | - private function get_search_result() |
|
| 86 | - { |
|
| 87 | - if(!isset($this->search_result)) |
|
| 88 | - { |
|
| 58 | + $keyword_array = self::$KEYWORD_ARRAY; |
|
| 59 | + array_unshift($keyword_array, $this->query); |
|
| 60 | + $this->set_keywords($keyword_array); |
|
| 61 | + } |
|
| 62 | + |
|
| 63 | + protected function get_introduction() |
|
| 64 | + { |
|
| 65 | + if($this->total_pages > 1) |
|
| 66 | + return array( |
|
| 67 | + 'title' => "Posts from search '{$this->query}', page {$this->page} of {$this->total_pages}."); |
|
| 68 | + else if($this->total_pages == 1) |
|
| 69 | + return array( |
|
| 70 | + 'title' => "Posts from search '{$this->query}'."); |
|
| 71 | + else |
|
| 72 | + return array( |
|
| 73 | + 'title' => "Sorry, '{$this->query}' didn't return any posts."); |
|
| 74 | + } |
|
| 75 | + |
|
| 76 | + protected function get_page_number() |
|
| 77 | + { |
|
| 78 | + $page = URLDecode::getPiece(3); |
|
| 79 | + if(isset($page) && is_numeric($page)) |
|
| 80 | + return $page; |
|
| 81 | + return 1; |
|
| 82 | + } |
|
| 83 | + |
|
| 84 | + private $search_result; |
|
| 85 | + private function get_search_result() |
|
| 86 | + { |
|
| 87 | + if(!isset($this->search_result)) |
|
| 88 | + { |
|
| 89 | 89 | global $container; |
| 90 | 90 | $repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']); |
| 91 | 91 | $posts = $repository->getActivePosts(); |
| 92 | 92 | |
| 93 | - $this->search_result = Search::instance() |
|
| 94 | - ->setQuery($this->query) |
|
| 95 | - ->setResult($posts) |
|
| 96 | - ->setWeight(self::$SEARCH_WEIGHTS) |
|
| 97 | - ->perform(); |
|
| 98 | - } |
|
| 99 | - return $this->search_result; |
|
| 100 | - } |
|
| 101 | - |
|
| 102 | - protected function get_list_results() |
|
| 103 | - { |
|
| 104 | - return array_slice($this->get_search_result(), $this->offset, self::$POSTS_PER_PAGE); |
|
| 105 | - } |
|
| 106 | - |
|
| 107 | - protected function get_list_description() |
|
| 108 | - { |
|
| 109 | - $start = $this->offset + 1; |
|
| 110 | - $end = min($this->offset + self::$POSTS_PER_PAGE, $this->get_total_post_count()); |
|
| 93 | + $this->search_result = Search::instance() |
|
| 94 | + ->setQuery($this->query) |
|
| 95 | + ->setResult($posts) |
|
| 96 | + ->setWeight(self::$SEARCH_WEIGHTS) |
|
| 97 | + ->perform(); |
|
| 98 | + } |
|
| 99 | + return $this->search_result; |
|
| 100 | + } |
|
| 101 | + |
|
| 102 | + protected function get_list_results() |
|
| 103 | + { |
|
| 104 | + return array_slice($this->get_search_result(), $this->offset, self::$POSTS_PER_PAGE); |
|
| 105 | + } |
|
| 106 | + |
|
| 107 | + protected function get_list_description() |
|
| 108 | + { |
|
| 109 | + $start = $this->offset + 1; |
|
| 110 | + $end = min($this->offset + self::$POSTS_PER_PAGE, $this->get_total_post_count()); |
|
| 111 | 111 | |
| 112 | - return sprintf(self::$LIST_DESCRIPTION, $start, $end, $this->get_total_post_count(), $this->query); |
|
| 113 | - } |
|
| 114 | - |
|
| 115 | - protected function get_list_next_link() |
|
| 116 | - { |
|
| 117 | - if($this->page == 1) |
|
| 118 | - return; |
|
| 119 | - if($this->page == 2) |
|
| 120 | - return Content::instance('URLSafe', "/search/{$this->query}/")->activate(); |
|
| 121 | - return Content::instance('URLSafe', "/search/{$this->query}/" . ($this->page - 1) . '/')->activate(); |
|
| 122 | - } |
|
| 123 | - |
|
| 124 | - protected function get_list_prev_link() |
|
| 125 | - { |
|
| 126 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
| 127 | - return; |
|
| 128 | - return Content::instance('URLSafe', "/search/{$this->query}/" . ($this->page + 1) . '/')->activate(); |
|
| 129 | - } |
|
| 130 | - |
|
| 131 | - private $total_post_count; |
|
| 132 | - protected function get_total_post_count() |
|
| 133 | - { |
|
| 134 | - if(!isset($this->total_post_count)) |
|
| 135 | - $this->total_post_count = count($this->get_search_result()); |
|
| 136 | - return $this->total_post_count; |
|
| 137 | - } |
|
| 112 | + return sprintf(self::$LIST_DESCRIPTION, $start, $end, $this->get_total_post_count(), $this->query); |
|
| 113 | + } |
|
| 114 | + |
|
| 115 | + protected function get_list_next_link() |
|
| 116 | + { |
|
| 117 | + if($this->page == 1) |
|
| 118 | + return; |
|
| 119 | + if($this->page == 2) |
|
| 120 | + return Content::instance('URLSafe', "/search/{$this->query}/")->activate(); |
|
| 121 | + return Content::instance('URLSafe', "/search/{$this->query}/" . ($this->page - 1) . '/')->activate(); |
|
| 122 | + } |
|
| 123 | + |
|
| 124 | + protected function get_list_prev_link() |
|
| 125 | + { |
|
| 126 | + if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
| 127 | + return; |
|
| 128 | + return Content::instance('URLSafe', "/search/{$this->query}/" . ($this->page + 1) . '/')->activate(); |
|
| 129 | + } |
|
| 130 | + |
|
| 131 | + private $total_post_count; |
|
| 132 | + protected function get_total_post_count() |
|
| 133 | + { |
|
| 134 | + if(!isset($this->total_post_count)) |
|
| 135 | + $this->total_post_count = count($this->get_search_result()); |
|
| 136 | + return $this->total_post_count; |
|
| 137 | + } |
|
| 138 | 138 | |
| 139 | 139 | } |
@@ -3,8 +3,8 @@ discard block |
||
| 3 | 3 | Loader::load('controller', 'blog/DefaultListController'); |
| 4 | 4 | Loader::load('utility', 'Search'); |
| 5 | 5 | |
| 6 | -final class SearchController extends DefaultListController |
|
| 7 | -{ |
|
| 6 | +final class SearchController extends DefaultListController |
|
| 7 | +{
|
|
| 8 | 8 | |
| 9 | 9 | private static $TITLE_MAIN = "%s Search | Jacob Emerick's Blog"; |
| 10 | 10 | private static $DESCRIPTION_MAIN = "Posts containing the phrase %s on Jacob Emerick's Blog."; |
@@ -29,8 +29,8 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | private $query; |
| 31 | 31 | |
| 32 | - public function __construct() |
|
| 33 | - { |
|
| 32 | + public function __construct() |
|
| 33 | + {
|
|
| 34 | 34 | $query = URLDecode::getPiece(2); |
| 35 | 35 | $query = urldecode($query); |
| 36 | 36 | $query = str_replace('-', ' ', $query); |
@@ -40,16 +40,15 @@ discard block |
||
| 40 | 40 | parent::__construct(); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - protected function set_head_data() |
|
| 44 | - { |
|
| 43 | + protected function set_head_data() |
|
| 44 | + {
|
|
| 45 | 45 | parent::set_head_data(); |
| 46 | 46 | |
| 47 | 47 | if($this->page == 1) |
| 48 | 48 | { |
| 49 | 49 | $this->set_title(sprintf(self::$TITLE_MAIN, ucwords($this->query))); |
| 50 | 50 | $this->set_description(sprintf(self::$DESCRIPTION_MAIN, ucwords($this->query))); |
| 51 | - } |
|
| 52 | - else |
|
| 51 | + } else |
|
| 53 | 52 | { |
| 54 | 53 | $this->set_title(sprintf(self::$TITLE_PAGINATED, ucwords($this->query), $this->page, $this->total_pages)); |
| 55 | 54 | $this->set_description(sprintf(self::$DESCRIPTION_PAGINATED, $this->page, $this->total_pages, ucwords($this->query))); |
@@ -60,30 +59,32 @@ discard block |
||
| 60 | 59 | $this->set_keywords($keyword_array); |
| 61 | 60 | } |
| 62 | 61 | |
| 63 | - protected function get_introduction() |
|
| 64 | - { |
|
| 65 | - if($this->total_pages > 1) |
|
| 66 | - return array( |
|
| 67 | - 'title' => "Posts from search '{$this->query}', page {$this->page} of {$this->total_pages}."); |
|
| 68 | - else if($this->total_pages == 1) |
|
| 69 | - return array( |
|
| 70 | - 'title' => "Posts from search '{$this->query}'."); |
|
| 71 | - else |
|
| 72 | - return array( |
|
| 73 | - 'title' => "Sorry, '{$this->query}' didn't return any posts."); |
|
| 62 | + protected function get_introduction() |
|
| 63 | + {
|
|
| 64 | + if($this->total_pages > 1) {
|
|
| 65 | + return array( |
|
| 66 | + 'title' => "Posts from search '{$this->query}', page {$this->page} of {$this->total_pages}.");
|
|
| 67 | + } else if($this->total_pages == 1) {
|
|
| 68 | + return array( |
|
| 69 | + 'title' => "Posts from search '{$this->query}'.");
|
|
| 70 | + } else {
|
|
| 71 | + return array( |
|
| 72 | + 'title' => "Sorry, '{$this->query}' didn't return any posts.");
|
|
| 73 | + } |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - protected function get_page_number() |
|
| 77 | - { |
|
| 76 | + protected function get_page_number() |
|
| 77 | + {
|
|
| 78 | 78 | $page = URLDecode::getPiece(3); |
| 79 | - if(isset($page) && is_numeric($page)) |
|
| 80 | - return $page; |
|
| 79 | + if(isset($page) && is_numeric($page)) {
|
|
| 80 | + return $page; |
|
| 81 | + } |
|
| 81 | 82 | return 1; |
| 82 | 83 | } |
| 83 | 84 | |
| 84 | 85 | private $search_result; |
| 85 | - private function get_search_result() |
|
| 86 | - { |
|
| 86 | + private function get_search_result() |
|
| 87 | + {
|
|
| 87 | 88 | if(!isset($this->search_result)) |
| 88 | 89 | { |
| 89 | 90 | global $container; |
@@ -99,40 +100,44 @@ discard block |
||
| 99 | 100 | return $this->search_result; |
| 100 | 101 | } |
| 101 | 102 | |
| 102 | - protected function get_list_results() |
|
| 103 | - { |
|
| 103 | + protected function get_list_results() |
|
| 104 | + {
|
|
| 104 | 105 | return array_slice($this->get_search_result(), $this->offset, self::$POSTS_PER_PAGE); |
| 105 | 106 | } |
| 106 | 107 | |
| 107 | - protected function get_list_description() |
|
| 108 | - { |
|
| 108 | + protected function get_list_description() |
|
| 109 | + {
|
|
| 109 | 110 | $start = $this->offset + 1; |
| 110 | 111 | $end = min($this->offset + self::$POSTS_PER_PAGE, $this->get_total_post_count()); |
| 111 | 112 | |
| 112 | 113 | return sprintf(self::$LIST_DESCRIPTION, $start, $end, $this->get_total_post_count(), $this->query); |
| 113 | 114 | } |
| 114 | 115 | |
| 115 | - protected function get_list_next_link() |
|
| 116 | - { |
|
| 117 | - if($this->page == 1) |
|
| 118 | - return; |
|
| 119 | - if($this->page == 2) |
|
| 120 | - return Content::instance('URLSafe', "/search/{$this->query}/")->activate(); |
|
| 116 | + protected function get_list_next_link() |
|
| 117 | + {
|
|
| 118 | + if($this->page == 1) {
|
|
| 119 | + return; |
|
| 120 | + } |
|
| 121 | + if($this->page == 2) {
|
|
| 122 | + return Content::instance('URLSafe', "/search/{$this->query}/")->activate();
|
|
| 123 | + } |
|
| 121 | 124 | return Content::instance('URLSafe', "/search/{$this->query}/" . ($this->page - 1) . '/')->activate(); |
| 122 | 125 | } |
| 123 | 126 | |
| 124 | - protected function get_list_prev_link() |
|
| 125 | - { |
|
| 126 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
| 127 | - return; |
|
| 127 | + protected function get_list_prev_link() |
|
| 128 | + {
|
|
| 129 | + if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) {
|
|
| 130 | + return; |
|
| 131 | + } |
|
| 128 | 132 | return Content::instance('URLSafe', "/search/{$this->query}/" . ($this->page + 1) . '/')->activate(); |
| 129 | 133 | } |
| 130 | 134 | |
| 131 | 135 | private $total_post_count; |
| 132 | - protected function get_total_post_count() |
|
| 133 | - { |
|
| 134 | - if(!isset($this->total_post_count)) |
|
| 135 | - $this->total_post_count = count($this->get_search_result()); |
|
| 136 | + protected function get_total_post_count() |
|
| 137 | + {
|
|
| 138 | + if(!isset($this->total_post_count)) {
|
|
| 139 | + $this->total_post_count = count($this->get_search_result()); |
|
| 140 | + } |
|
| 136 | 141 | return $this->total_post_count; |
| 137 | 142 | } |
| 138 | 143 | |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | { |
| 26 | 26 | $this->set_body('body_view', 'Resume'); |
| 27 | 27 | |
| 28 | - $resumePath = Loader::getRootURL('portfolio') . "/jsonresume/{$this->resume}"; |
|
| 28 | + $resumePath = Loader::getRootURL('portfolio')."/jsonresume/{$this->resume}"; |
|
| 29 | 29 | $resume = file_get_contents($resumePath); |
| 30 | 30 | $resume = json_decode($resume, true); |
| 31 | 31 | $this->set_body('body_data', $resume); |
@@ -2,13 +2,13 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | Loader::load('controller', 'portfolio/DefaultPageController'); |
| 4 | 4 | |
| 5 | -class ResumeController extends DefaultPageController |
|
| 6 | -{ |
|
| 5 | +class ResumeController extends DefaultPageController |
|
| 6 | +{
|
|
| 7 | 7 | |
| 8 | 8 | protected $resume = 'resume-20160318.json'; |
| 9 | 9 | |
| 10 | - protected function set_head_data() |
|
| 11 | - { |
|
| 10 | + protected function set_head_data() |
|
| 11 | + {
|
|
| 12 | 12 | $this->set_title("Resume | Jacob Emerick's Portfolio"); |
| 13 | 13 | $this->set_description("Resume for Jacob Emerick, a software engineer extraordinaire"); |
| 14 | 14 | $this->set_keywords([ |
@@ -21,8 +21,8 @@ discard block |
||
| 21 | 21 | ]); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - protected function set_body_data() |
|
| 25 | - { |
|
| 24 | + protected function set_body_data() |
|
| 25 | + {
|
|
| 26 | 26 | $this->set_body('body_view', 'Resume'); |
| 27 | 27 | |
| 28 | 28 | $resumePath = Loader::getRootURL('portfolio') . "/jsonresume/{$this->resume}"; |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | |
| 90 | 90 | return [ |
| 91 | 91 | 'success' => |
| 92 | - "Thank you for your message, {$_POST['name']}! " . |
|
| 92 | + "Thank you for your message, {$_POST['name']}! ". |
|
| 93 | 93 | "I'll get back to you as soon as possible." |
| 94 | 94 | ]; |
| 95 | 95 | } |
@@ -2,11 +2,11 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | Loader::load('controller', 'portfolio/DefaultPageController'); |
| 4 | 4 | |
| 5 | -class ContactController extends DefaultPageController |
|
| 6 | -{ |
|
| 5 | +class ContactController extends DefaultPageController |
|
| 6 | +{
|
|
| 7 | 7 | |
| 8 | - protected function set_head_data() |
|
| 9 | - { |
|
| 8 | + protected function set_head_data() |
|
| 9 | + {
|
|
| 10 | 10 | $this->set_title("Contact Page | Jacob Emerick's Portfolio"); |
| 11 | 11 | $this->set_description("Contact page for Jacob Emerick's Portfolio"); |
| 12 | 12 | $this->set_keywords([ |
@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | ]); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - protected function set_body_data() |
|
| 23 | - { |
|
| 22 | + protected function set_body_data() |
|
| 23 | + {
|
|
| 24 | 24 | $this->set_body('body_view', 'Contact'); |
| 25 | 25 | |
| 26 | 26 | $body_data = []; |
@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | parent::set_body_data(); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - private function process_form_data() |
|
| 37 | - { |
|
| 36 | + private function process_form_data() |
|
| 37 | + {
|
|
| 38 | 38 | $errors = []; |
| 39 | 39 | |
| 40 | 40 | if ( |
@@ -33,15 +33,15 @@ discard block |
||
| 33 | 33 | ], |
| 34 | 34 | [ |
| 35 | 35 | 'name' => 'Projects', |
| 36 | - 'link' => Loader::getRootURL() . 'projects/', |
|
| 36 | + 'link' => Loader::getRootURL().'projects/', |
|
| 37 | 37 | ], |
| 38 | 38 | [ |
| 39 | 39 | 'name' => 'Résumé', |
| 40 | - 'link' => Loader::getRootURL() . 'resume/', |
|
| 40 | + 'link' => Loader::getRootURL().'resume/', |
|
| 41 | 41 | ], |
| 42 | 42 | [ |
| 43 | 43 | 'name' => 'Contact', |
| 44 | - 'link' => Loader::getRootURL() . 'contact/', |
|
| 44 | + 'link' => Loader::getRootURL().'contact/', |
|
| 45 | 45 | ], |
| 46 | 46 | ]; |
| 47 | 47 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $active_page = ucfirst(URLDecode::getPiece(1)); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - return array_map(function ($row) use ($active_page) { |
|
| 54 | + return array_map(function($row) use ($active_page) { |
|
| 55 | 55 | $row = (object) $row; |
| 56 | 56 | $row->active = ($row->name == $active_page); |
| 57 | 57 | return $row; |
@@ -2,19 +2,19 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | Loader::load('controller', '/PageController'); |
| 4 | 4 | |
| 5 | -abstract class DefaultPageController extends PageController |
|
| 6 | -{ |
|
| 5 | +abstract class DefaultPageController extends PageController |
|
| 6 | +{
|
|
| 7 | 7 | |
| 8 | - public function __construct() |
|
| 9 | - { |
|
| 8 | + public function __construct() |
|
| 9 | + {
|
|
| 10 | 10 | parent::__construct(); |
| 11 | 11 | |
| 12 | 12 | $this->add_css('reset'); |
| 13 | 13 | $this->add_css('portfolio', 4); |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | - protected function set_body_data() |
|
| 17 | - { |
|
| 16 | + protected function set_body_data() |
|
| 17 | + {
|
|
| 18 | 18 | $this->set_body('header_data', [ |
| 19 | 19 | 'menu' => $this->get_menu(), |
| 20 | 20 | 'home_link' => Loader::getRootURL(), |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | $this->set_body_view('Page'); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - protected function get_menu() |
|
| 28 | - { |
|
| 27 | + protected function get_menu() |
|
| 28 | + {
|
|
| 29 | 29 | $menu = [ |
| 30 | 30 | [ |
| 31 | 31 | 'name' => 'About', |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Jacobemerick\Web\Domain\Comment\Comment; |
| 4 | 4 | |
| 5 | -interface CommentRepositoryInterface |
|
| 6 | -{ |
|
| 5 | +interface CommentRepositoryInterface |
|
| 6 | +{
|
|
| 7 | 7 | public function createComment(array $comment); |
| 8 | 8 | public function getComment($commentId); |
| 9 | 9 | public function getComments($domain = null, $path = null, $page = null, $perPage = null, $order = null); |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Jacobemerick\Web\Domain\Comment\Commenter; |
| 4 | 4 | |
| 5 | -interface CommenterRepositoryInterface |
|
| 6 | -{ |
|
| 5 | +interface CommenterRepositoryInterface |
|
| 6 | +{
|
|
| 7 | 7 | public function createCommenter(array $commenter); |
| 8 | 8 | public function getCommenter($commenterId); |
| 9 | 9 | public function getCommenters($page = null, $perPage = null); |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Jacobemerick\Web\Domain\Waterfall\County; |
| 4 | 4 | |
| 5 | -interface CountyRepositoryInterface |
|
| 6 | -{ |
|
| 5 | +interface CountyRepositoryInterface |
|
| 6 | +{
|
|
| 7 | 7 | public function getCountyList(); |
| 8 | 8 | } |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Jacobemerick\Web\Domain\Waterfall\Period; |
| 4 | 4 | |
| 5 | -interface PeriodRepositoryInterface |
|
| 6 | -{ |
|
| 5 | +interface PeriodRepositoryInterface |
|
| 6 | +{
|
|
| 7 | 7 | public function getPeriodList(); |
| 8 | 8 | } |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Jacobemerick\Web\Domain\Waterfall\Watercourse; |
| 4 | 4 | |
| 5 | -interface WatercourseRepositoryInterface |
|
| 6 | -{ |
|
| 5 | +interface WatercourseRepositoryInterface |
|
| 6 | +{
|
|
| 7 | 7 | public function getWatercourseList(); |
| 8 | 8 | } |