@@ -18,10 +18,10 @@ discard block |
||
18 | 18 | |
19 | 19 | private static function get_router_name() |
20 | 20 | { |
21 | - if(Request::isAJAX()) |
|
21 | + if (Request::isAJAX()) |
|
22 | 22 | return 'AJAXRouter'; |
23 | 23 | |
24 | - switch(URLDecode::getSite()) |
|
24 | + switch (URLDecode::getSite()) |
|
25 | 25 | { |
26 | 26 | case 'ajax' : |
27 | 27 | return 'AjaxRouter'; |
@@ -66,36 +66,36 @@ discard block |
||
66 | 66 | |
67 | 67 | final protected function check_for_redirect($redirect_uri) |
68 | 68 | { |
69 | - foreach($this->get_redirect_array() as $check) |
|
69 | + foreach ($this->get_redirect_array() as $check) |
|
70 | 70 | { |
71 | 71 | $redirect_uri = preg_replace($check->pattern, $check->replace, $redirect_uri); |
72 | 72 | } |
73 | 73 | |
74 | 74 | $redirect_uri = $this->check_for_special_redirect($redirect_uri); |
75 | 75 | |
76 | - if($this->requires_trailing_slash() && substr($redirect_uri, -1) != '/') |
|
76 | + if ($this->requires_trailing_slash() && substr($redirect_uri, -1) != '/') |
|
77 | 77 | $redirect_uri .= '/'; |
78 | 78 | |
79 | 79 | if (URLDecode::getHost() == 'waterfalls.jacobemerick.com') { |
80 | 80 | $redirect_uri = 'http://' . (!Loader::isLive() ? 'dev' : 'www') . '.waterfallsofthekeweenaw.com' . $redirect_uri; |
81 | 81 | } |
82 | 82 | |
83 | - if($redirect_uri == URLDecode::getURI()) |
|
83 | + if ($redirect_uri == URLDecode::getURI()) |
|
84 | 84 | return; |
85 | 85 | |
86 | 86 | $controller_check = $redirect_uri; |
87 | - if(substr($redirect_uri, 0, 4) == 'http') |
|
87 | + if (substr($redirect_uri, 0, 4) == 'http') |
|
88 | 88 | $controller_check = preg_replace('@^http://([a-z\.]+)@', '', $redirect_uri); |
89 | 89 | |
90 | 90 | $controller = $this->get_controller($controller_check); |
91 | - if($controller == '/Error404Controller') |
|
91 | + if ($controller == '/Error404Controller') |
|
92 | 92 | { |
93 | 93 | Loader::loadNew('controller', '/Error404Controller') |
94 | 94 | ->activate(); |
95 | 95 | exit; |
96 | 96 | } |
97 | 97 | |
98 | - if(substr($redirect_uri, 0, 4) != 'http') |
|
98 | + if (substr($redirect_uri, 0, 4) != 'http') |
|
99 | 99 | { |
100 | 100 | $redirect_uri = substr($redirect_uri, 1); |
101 | 101 | $redirect_uri = URLDecode::getBase() . $redirect_uri; |
@@ -112,12 +112,12 @@ discard block |
||
112 | 112 | |
113 | 113 | final private function get_controller($uri) |
114 | 114 | { |
115 | - foreach($this->get_direct_array() as $check) |
|
115 | + foreach ($this->get_direct_array() as $check) |
|
116 | 116 | { |
117 | - if($uri == $check->match) |
|
117 | + if ($uri == $check->match) |
|
118 | 118 | return "{$this->get_primary_folder()}/{$check->controller}"; |
119 | 119 | |
120 | - if(preg_match("@^{$check->match}$@", $uri)) |
|
120 | + if (preg_match("@^{$check->match}$@", $uri)) |
|
121 | 121 | return "{$this->get_primary_folder()}/{$check->controller}"; |
122 | 122 | } |
123 | 123 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | final private function get_primary_folder() |
128 | 128 | { |
129 | - if(Request::isAjax()) |
|
129 | + if (Request::isAjax()) |
|
130 | 130 | return 'ajax'; |
131 | 131 | |
132 | 132 | return URLDecode::getSite(); |
@@ -4,5 +4,5 @@ |
||
4 | 4 | |
5 | 5 | interface PieceRepositoryInterface |
6 | 6 | { |
7 | - public function getPieces($limit = null, $offset= 0); |
|
7 | + public function getPieces($limit = null, $offset = 0); |
|
8 | 8 | } |
@@ -4,5 +4,5 @@ |
||
4 | 4 | |
5 | 5 | interface LogRepositoryInterface |
6 | 6 | { |
7 | - public function getActiveLogs($limit = null, $offset= 0); |
|
7 | + public function getActiveLogs($limit = null, $offset = 0); |
|
8 | 8 | } |
@@ -4,5 +4,5 @@ |
||
4 | 4 | |
5 | 5 | interface WaterfallRepositoryInterface |
6 | 6 | { |
7 | - public function getWaterfalls($limit = null, $offset= 0); |
|
7 | + public function getWaterfalls($limit = null, $offset = 0); |
|
8 | 8 | } |
@@ -4,5 +4,5 @@ |
||
4 | 4 | |
5 | 5 | interface CommentRepositoryInterface |
6 | 6 | { |
7 | - public function getActiveCommentsBySite($site, $limit = null, $offset= 0); |
|
7 | + public function getActiveCommentsBySite($site, $limit = null, $offset = 0); |
|
8 | 8 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | * @param string $folder |
17 | 17 | * @return boolean |
18 | 18 | */ |
19 | -$buildFeed = function (Feed $feed, $folder, $name = 'rss') { |
|
19 | +$buildFeed = function(Feed $feed, $folder, $name = 'rss') { |
|
20 | 20 | $tempFeed = __DIR__ . "/../../public/{$folder}/{$name}-new.xml"; |
21 | 21 | $finalFeed = __DIR__ . "/../../public/{$folder}/{$name}.xml"; |
22 | 22 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * @param string $domain |
27 | 27 | * @return boolean |
28 | 28 | */ |
29 | -$buildSitemap = function (array $entries, $domain, $folder) { |
|
29 | +$buildSitemap = function(array $entries, $domain, $folder) { |
|
30 | 30 | $urlSet = new Urlset(); |
31 | 31 | foreach ($entries as $path => $entry) { |
32 | 32 | $url = new Url("{$domain}{$path}"); // todo better detection of domain by env |
@@ -53,13 +53,13 @@ discard block |
||
53 | 53 | /********************************************* |
54 | 54 | * blog.jacobemerick.com |
55 | 55 | *********************************************/ |
56 | -$reduceToMostRecentBlogPost = function ($recentPost, $post) { |
|
56 | +$reduceToMostRecentBlogPost = function($recentPost, $post) { |
|
57 | 57 | if (is_null($recentPost)) { |
58 | 58 | return $post; |
59 | 59 | } |
60 | 60 | $postDate = new DateTime($post['date']); |
61 | 61 | $recentPostDate = new DateTime($recentPost['date']); |
62 | - return ($postDate > $recentPostDate) ? $post: $recentPost; |
|
62 | + return ($postDate > $recentPostDate) ? $post : $recentPost; |
|
63 | 63 | }; |
64 | 64 | |
65 | 65 | $blogPostsPerPage = 10; |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | ]; |
95 | 95 | |
96 | 96 | foreach ($blogCategoryArray as $blogCategory) { |
97 | - $blogCategoryPosts = array_filter($activeBlogPosts, function ($post) use ($blogCategory) { |
|
97 | + $blogCategoryPosts = array_filter($activeBlogPosts, function($post) use ($blogCategory) { |
|
98 | 98 | return $post['category'] == $blogCategory; |
99 | 99 | }); |
100 | 100 | $mostRecentBlogCategoryPost = array_reduce($blogCategoryPosts, $reduceToMostRecentBlogPost); |
@@ -207,13 +207,13 @@ discard block |
||
207 | 207 | /********************************************* |
208 | 208 | * lifestream.jacobemerick.com |
209 | 209 | *********************************************/ |
210 | -$reduceToMostRecentStreamActivity = function ($recentActivity, $activity) { |
|
210 | +$reduceToMostRecentStreamActivity = function($recentActivity, $activity) { |
|
211 | 211 | if (is_null($recentActivity)) { |
212 | 212 | return $activity; |
213 | 213 | } |
214 | 214 | $activityDate = new DateTime($activity['datetime']); |
215 | 215 | $recentActivityDate = new DateTime($recentActivity['datetime']); |
216 | - return ($activityDate > $recentActivityDate) ? $activity: $recentActivity; |
|
216 | + return ($activityDate > $recentActivityDate) ? $activity : $recentActivity; |
|
217 | 217 | }; |
218 | 218 | |
219 | 219 | $streamActivitiesPerPage = 15; |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | ]; |
252 | 252 | |
253 | 253 | foreach ($streamTypeArray as $streamType) { |
254 | - $streamTypeActivities = array_filter($streamActivities, function ($post) use ($streamType) { |
|
254 | + $streamTypeActivities = array_filter($streamActivities, function($post) use ($streamType) { |
|
255 | 255 | return $post['type'] == $streamType; |
256 | 256 | }); |
257 | 257 | $mostRecentStreamTypeActivity = array_reduce($streamTypeActivities, $reduceToMostRecentStreamActivity); |
@@ -385,13 +385,13 @@ discard block |
||
385 | 385 | /********************************************* |
386 | 386 | * www.waterfallofthekeweenaw.com |
387 | 387 | *********************************************/ |
388 | -$reduceToMostRecentJournalLog = function ($recentLog, $log) { |
|
388 | +$reduceToMostRecentJournalLog = function($recentLog, $log) { |
|
389 | 389 | if (is_null($recentLog)) { |
390 | 390 | return $log; |
391 | 391 | } |
392 | 392 | $logDate = new DateTime($log['publish_date']); |
393 | 393 | $recentLogDate = new DateTime($recentLog['publish_date']); |
394 | - return ($logDate > $recentLogDate) ? log: $recentLog; |
|
394 | + return ($logDate > $recentLogDate) ? log : $recentLog; |
|
395 | 395 | }; |
396 | 396 | |
397 | 397 | $waterfallRepository = new WaterfallRepository($container['db_connection_locator']); |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | |
396 | 396 | $message = $twitterData['text']; |
397 | 397 | krsort($entityHolder); |
398 | - foreach($entityHolder as $entity) |
|
398 | + foreach ($entityHolder as $entity) |
|
399 | 399 | { |
400 | 400 | $message = |
401 | 401 | mb_substr($message, 0, $entity['start']) . |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | |
453 | 453 | $messageLong = $twitterData['text']; |
454 | 454 | krsort($entityHolder); |
455 | - foreach($entityHolder as $entity) |
|
455 | + foreach ($entityHolder as $entity) |
|
456 | 456 | { |
457 | 457 | $messageLong = |
458 | 458 | mb_substr($messageLong, 0, $entity['start']) . |
@@ -34,10 +34,10 @@ |
||
34 | 34 | ->getRead() |
35 | 35 | ->getProfiler() |
36 | 36 | ->getProfiles(); |
37 | - $dbProfiles = array_filter($dbProfiles, function ($profile) { |
|
37 | + $dbProfiles = array_filter($dbProfiles, function($profile) { |
|
38 | 38 | return $profile['function'] == 'perform'; |
39 | 39 | }); |
40 | - $dbProfiles = array_map(function ($profile) { |
|
40 | + $dbProfiles = array_map(function($profile) { |
|
41 | 41 | return [ |
42 | 42 | 'sql' => trim(preg_replace('/\s+/', ' ', $profile['statement'])), |
43 | 43 | 'parameters' => $profile['bind_values'], |