@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | $namespace = 'portfolio'; |
4 | -require_once __DIR__ . '/../../bootstrap.php'; |
|
4 | +require_once __DIR__.'/../../bootstrap.php'; |
|
5 | 5 | |
6 | 6 | // route |
7 | 7 | Loader::loadInstance('router', 'Router'); |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | $namespace = 'portfolio'; |
4 | -require_once __DIR__ . '/../../bootstrap.php'; |
|
4 | +require_once __DIR__.'/../../bootstrap.php'; |
|
5 | 5 | |
6 | 6 | // route |
7 | 7 | Loader::loadInstance('router', 'Router'); |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | $namespace = 'portfolio'; |
4 | -require_once __DIR__ . '/../../bootstrap.php'; |
|
4 | +require_once __DIR__.'/../../bootstrap.php'; |
|
5 | 5 | |
6 | 6 | // route |
7 | 7 | Loader::loadInstance('router', 'Router'); |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | $namespace = 'portfolio'; |
4 | -require_once __DIR__ . '/../../bootstrap.php'; |
|
4 | +require_once __DIR__.'/../../bootstrap.php'; |
|
5 | 5 | |
6 | 6 | // route |
7 | 7 | Loader::loadInstance('router', 'Router'); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | )" |
49 | 49 | ); |
50 | 50 | |
51 | - self::$connection = new ConnectionLocator(function () use ($extendedPdo) { |
|
51 | + self::$connection = new ConnectionLocator(function() use ($extendedPdo) { |
|
52 | 52 | return $extendedPdo; |
53 | 53 | }); |
54 | 54 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $this->assertInternalType('array', $data); |
174 | 174 | $this->assertCount(count($testData), $data); |
175 | 175 | |
176 | - usort($testData, function ($rowA, $rowB) { |
|
176 | + usort($testData, function($rowA, $rowB) { |
|
177 | 177 | return ((new DateTime($rowA['date'])) < (new DateTime($rowB['date']))); |
178 | 178 | }); |
179 | 179 | |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | $this->assertNotFalse($data); |
219 | 219 | $this->assertInternalType('array', $data); |
220 | 220 | |
221 | - $testData = array_filter($testData, function ($row) { |
|
221 | + $testData = array_filter($testData, function($row) { |
|
222 | 222 | return ($row['display'] == 1); |
223 | 223 | }); |
224 | 224 | |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | $this->assertNotFalse($data); |
354 | 354 | $this->assertStringMatchesFormat('%d', $data); |
355 | 355 | |
356 | - $testData = array_filter($testData, function ($row) { |
|
356 | + $testData = array_filter($testData, function($row) { |
|
357 | 357 | return ($row['display'] == 1); |
358 | 358 | }); |
359 | 359 | |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | $this->assertInternalType('array', $data); |
417 | 417 | $this->assertCount(count($testPostData), $data); |
418 | 418 | |
419 | - usort($testPostData, function ($rowA, $rowB) { |
|
419 | + usort($testPostData, function($rowA, $rowB) { |
|
420 | 420 | return ((new DateTime($rowA['date'])) < (new DateTime($rowB['date']))); |
421 | 421 | }); |
422 | 422 | |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | $this->assertNotFalse($data); |
476 | 476 | $this->assertInternalType('array', $data); |
477 | 477 | |
478 | - $testPostData = array_filter($testPostData, function ($row) { |
|
478 | + $testPostData = array_filter($testPostData, function($row) { |
|
479 | 479 | return ($row['display'] == 1); |
480 | 480 | }); |
481 | 481 | |
@@ -675,7 +675,7 @@ discard block |
||
675 | 675 | $this->assertNotFalse($data); |
676 | 676 | $this->assertStringMatchesFormat('%d', $data); |
677 | 677 | |
678 | - $testPostData = array_filter($testPostData, function ($row) { |
|
678 | + $testPostData = array_filter($testPostData, function($row) { |
|
679 | 679 | return ($row['display'] == 1); |
680 | 680 | }); |
681 | 681 | |
@@ -730,7 +730,7 @@ discard block |
||
730 | 730 | $this->assertInternalType('array', $data); |
731 | 731 | $this->assertCount(count($testData), $data); |
732 | 732 | |
733 | - usort($testData, function ($rowA, $rowB) { |
|
733 | + usort($testData, function($rowA, $rowB) { |
|
734 | 734 | return ((new DateTime($rowA['date'])) < (new DateTime($rowB['date']))); |
735 | 735 | }); |
736 | 736 | |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | $this->assertNotFalse($data); |
779 | 779 | $this->assertInternalType('array', $data); |
780 | 780 | |
781 | - $testData = array_filter($testData, function ($row) { |
|
781 | + $testData = array_filter($testData, function($row) { |
|
782 | 782 | return ($row['display'] == 1); |
783 | 783 | }); |
784 | 784 | |
@@ -930,7 +930,7 @@ discard block |
||
930 | 930 | $this->assertNotFalse($data); |
931 | 931 | $this->assertStringMatchesFormat('%d', $data); |
932 | 932 | |
933 | - $testData = array_filter($testData, function ($row) { |
|
933 | + $testData = array_filter($testData, function($row) { |
|
934 | 934 | return ($row['display'] == 1); |
935 | 935 | }); |
936 | 936 | |
@@ -1118,7 +1118,7 @@ discard block |
||
1118 | 1118 | $this->assertInternalType('array', $data); |
1119 | 1119 | |
1120 | 1120 | array_shift($testPostData); |
1121 | - $testPostData = array_filter($testPostData, function ($row) { |
|
1121 | + $testPostData = array_filter($testPostData, function($row) { |
|
1122 | 1122 | return ($row['display'] == 1); |
1123 | 1123 | }); |
1124 | 1124 | |
@@ -1190,7 +1190,7 @@ discard block |
||
1190 | 1190 | $this->assertInternalType('array', $data); |
1191 | 1191 | |
1192 | 1192 | array_shift($testPostData); |
1193 | - $testPostData = array_filter($testPostData, function ($row) use ($testSeriesPostData) { |
|
1193 | + $testPostData = array_filter($testPostData, function($row) use ($testSeriesPostData) { |
|
1194 | 1194 | return (!in_array($row['id'], array_column($testSeriesPostData, 'post'))); |
1195 | 1195 | }); |
1196 | 1196 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | Loader::load('collector', 'image/PhotoCollector'); |
42 | 42 | $photo_result = PhotoCollector::getRow($id); |
43 | 43 | |
44 | - if($photo_result == null) |
|
44 | + if ($photo_result == null) |
|
45 | 45 | return; |
46 | 46 | |
47 | 47 | $name = $photo_result->name; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $tag_result = $repository->getTagsForPost($post['id']); |
93 | 93 | |
94 | 94 | $tag_array = array(); |
95 | - foreach($tag_result as $tag) |
|
95 | + foreach ($tag_result as $tag) |
|
96 | 96 | { |
97 | 97 | $tag_object = new stdclass(); |
98 | 98 | $tag_object->name = $tag['tag']; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | { |
107 | 107 | $body = $post['body']; |
108 | 108 | |
109 | - if($trim) |
|
109 | + if ($trim) |
|
110 | 110 | $body = Content::instance('SmartTrim', $body)->activate(self::$LENGTH_OF_TRIMMED_POST); |
111 | 111 | |
112 | 112 | $body = Content::instance('FixPhoto', $body)->activate(false, 'standard'); |
@@ -132,9 +132,9 @@ discard block |
||
132 | 132 | $maximum_tag_count = $this->get_maximum_tag_count($tag_result); |
133 | 133 | |
134 | 134 | $cloud_array = array(); |
135 | - foreach($tag_result as $tag) |
|
135 | + foreach ($tag_result as $tag) |
|
136 | 136 | { |
137 | - if($tag['count'] < self::$MINIMUM_TAG_COUNT) |
|
137 | + if ($tag['count'] < self::$MINIMUM_TAG_COUNT) |
|
138 | 138 | continue; |
139 | 139 | |
140 | 140 | $tag_object = new stdclass(); |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | { |
152 | 152 | $maximum = 1; |
153 | 153 | |
154 | - foreach($tag_result as $tag) |
|
154 | + foreach ($tag_result as $tag) |
|
155 | 155 | { |
156 | - if($tag['count'] > $maximum) |
|
156 | + if ($tag['count'] > $maximum) |
|
157 | 157 | $maximum = $tag['count']; |
158 | 158 | } |
159 | 159 | return $maximum; |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $comment_array = CommentCollector::getRecentBlogComments(self::$RECENT_COMMENT_COUNT); |
165 | 165 | |
166 | 166 | $array = array(); |
167 | - foreach($comment_array as $comment) |
|
167 | + foreach ($comment_array as $comment) |
|
168 | 168 | { |
169 | 169 | $body = $comment->body; |
170 | 170 | $body = strip_tags($body); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | $comment_obj = new stdclass(); |
173 | 173 | $comment_obj->description = Content::instance('SmartTrim', $body)->activate(30); |
174 | 174 | $comment_obj->commenter = $comment->name; |
175 | - $comment_obj->link = Loader::getRootURL() . "{$comment->category}/{$comment->path}/#comment-{$comment->id}"; |
|
175 | + $comment_obj->link = Loader::getRootURL()."{$comment->category}/{$comment->path}/#comment-{$comment->id}"; |
|
176 | 176 | $array[] = $comment_obj; |
177 | 177 | } |
178 | 178 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $comment_response = $api->getComments(1, self::$RECENT_COMMENT_COUNT, '-date', 'blog.jacobemerick.com'); |
202 | 202 | |
203 | 203 | $array = array(); |
204 | - foreach($comment_response as $comment) |
|
204 | + foreach ($comment_response as $comment) |
|
205 | 205 | { |
206 | 206 | $body = $comment->getBody(); |
207 | 207 | $body = strip_tags($body); |
@@ -5,13 +5,13 @@ discard block |
||
5 | 5 | ini_set('display_errors', 0); |
6 | 6 | |
7 | 7 | |
8 | -require_once __DIR__ . '/vendor/autoload.php'; |
|
8 | +require_once __DIR__.'/vendor/autoload.php'; |
|
9 | 9 | |
10 | 10 | $container = new Pimple\Container(); |
11 | 11 | |
12 | 12 | |
13 | 13 | // load the config for the application |
14 | -$config_path = __DIR__ . '/config.json'; |
|
14 | +$config_path = __DIR__.'/config.json'; |
|
15 | 15 | |
16 | 16 | $handle = @fopen($config_path, 'r'); |
17 | 17 | if ($handle === false) { |
@@ -29,14 +29,14 @@ discard block |
||
29 | 29 | |
30 | 30 | // timezones are fun |
31 | 31 | date_default_timezone_set('America/Phoenix'); // todo - belongs in configuration |
32 | -$container['default_timezone'] = function ($c) { |
|
32 | +$container['default_timezone'] = function($c) { |
|
33 | 33 | return new DateTimeZone('America/Phoenix'); |
34 | 34 | }; |
35 | 35 | |
36 | 36 | |
37 | 37 | // configure the db connections holder |
38 | 38 | $db_connections = new Aura\Sql\ConnectionLocator(); |
39 | -$db_connections->setDefault(function () use ($config) { |
|
39 | +$db_connections->setDefault(function() use ($config) { |
|
40 | 40 | $connection = $config->database->slave; |
41 | 41 | return new Aura\Sql\ExtendedPdo( |
42 | 42 | "mysql:host={$connection->host}", |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $connection->password |
45 | 45 | ); |
46 | 46 | }); |
47 | -$db_connections->setWrite('master', function () use ($config) { |
|
47 | +$db_connections->setWrite('master', function() use ($config) { |
|
48 | 48 | $connection = $config->database->master; |
49 | 49 | return new Aura\Sql\ExtendedPdo( |
50 | 50 | "mysql:host={$connection->host}", |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $connection->password |
53 | 53 | ); |
54 | 54 | }); |
55 | -$db_connections->setRead('slave', function () use ($config) { |
|
55 | +$db_connections->setRead('slave', function() use ($config) { |
|
56 | 56 | $connection = $config->database->slave; |
57 | 57 | $pdo = new Aura\Sql\ExtendedPdo( |
58 | 58 | "mysql:host={$connection->host}", |
@@ -70,16 +70,16 @@ discard block |
||
70 | 70 | |
71 | 71 | |
72 | 72 | // setup mail handler |
73 | -$container['mail'] = $container->factory(function ($c) { |
|
73 | +$container['mail'] = $container->factory(function($c) { |
|
74 | 74 | return (new Jacobemerick\Archangel\Archangel())->setLogger($c['logger']); |
75 | 75 | }); |
76 | 76 | |
77 | 77 | |
78 | 78 | // setup the logger |
79 | -$container['setup_logger'] = $container->protect(function ($name) use ($container) { |
|
79 | +$container['setup_logger'] = $container->protect(function($name) use ($container) { |
|
80 | 80 | $logger = new Monolog\Logger($name); |
81 | 81 | |
82 | - $logPath = __DIR__ . "/logs/{$name}.log"; |
|
82 | + $logPath = __DIR__."/logs/{$name}.log"; |
|
83 | 83 | $streamHandler = new Monolog\Handler\StreamHandler($logPath, Monolog\Logger::INFO); |
84 | 84 | $streamHandler->setFormatter( |
85 | 85 | new Monolog\Formatter\LineFormatter("[%datetime%] %channel%.%level_name%: %message%\n") |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | |
109 | 109 | // sets up shutdown function to display profiler |
110 | -register_shutdown_function(function () use ($container) { |
|
110 | +register_shutdown_function(function() use ($container) { |
|
111 | 111 | if ( |
112 | 112 | !isset($_COOKIE['debugger']) || |
113 | 113 | $_COOKIE['debugger'] != 'display' |
@@ -119,10 +119,10 @@ discard block |
||
119 | 119 | ->getRead() |
120 | 120 | ->getProfiler() |
121 | 121 | ->getProfiles(); |
122 | - $dbProfiles = array_filter($dbProfiles, function ($profile) { |
|
122 | + $dbProfiles = array_filter($dbProfiles, function($profile) { |
|
123 | 123 | return $profile['function'] == 'perform'; |
124 | 124 | }); |
125 | - $dbProfiles = array_map(function ($profile) { |
|
125 | + $dbProfiles = array_map(function($profile) { |
|
126 | 126 | return [ |
127 | 127 | 'sql' => trim(preg_replace('/\s+/', ' ', $profile['statement'])), |
128 | 128 | 'parameters' => $profile['bind_values'], |