Completed
Push — master ( 04228d...052193 )
by Jacob
08:02
created
src/Domain/Waterfall/Watercourse/MysqlWatercourseRepository.php 2 patches
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 
5 5
 use Aura\Sql\ConnectionLocator;
6 6
 
7
-class MysqlWatercourseRepository implements WatercourseRepositoryInterface
8
-{
7
+class MysqlWatercourseRepository implements WatercourseRepositoryInterface
8
+{
9 9
 
10 10
     /** @var  Aura\Sql\ConnectionLocator */
11 11
     protected $connections;
@@ -13,14 +13,14 @@  discard block
 block discarded – undo
13 13
     /**
14 14
      * @param Aura\Sql\ConnectionLocator $connections
15 15
      */
16
-    public function __construct(ConnectionLocator $connections)
17
-    {
16
+    public function __construct(ConnectionLocator $connections)
17
+    {
18 18
         $this->connections = $connections;
19 19
     }
20 20
 
21 21
     // todo wot are you even serious
22
-    public function getWatercourseList()
23
-    {
22
+    public function getWatercourseList()
23
+    {
24 24
         $query = "
25 25
             SELECT `sum_table`.`name`, `sum_table`.`alias`, SUM(`count`) AS `count`
26 26
             FROM ((
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     protected $connections;
12 12
 
13 13
     /**
14
-     * @param Aura\Sql\ConnectionLocator $connections
14
+     * @param ConnectionLocator $connections
15 15
      */
16 16
     public function __construct(ConnectionLocator $connections)
17 17
     {
Please login to merge, or discard this patch.
src/Domain/Waterfall/County/MysqlCountyRepository.php 2 patches
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 
5 5
 use Aura\Sql\ConnectionLocator;
6 6
 
7
-class MysqlCountyRepository implements CountyRepositoryInterface
8
-{
7
+class MysqlCountyRepository implements CountyRepositoryInterface
8
+{
9 9
 
10 10
     /** @var  Aura\Sql\ConnectionLocator */
11 11
     protected $connections;
@@ -13,13 +13,13 @@  discard block
 block discarded – undo
13 13
     /**
14 14
      * @param Aura\Sql\ConnectionLocator $connections
15 15
      */
16
-    public function __construct(ConnectionLocator $connections)
17
-    {
16
+    public function __construct(ConnectionLocator $connections)
17
+    {
18 18
         $this->connections = $connections;
19 19
     }
20 20
 
21
-    public function getCountyList()
22
-    {
21
+    public function getCountyList()
22
+    {
23 23
         $query = "
24 24
             SELECT `county`.`name`, `county`.`alias`, COUNT(1) AS `count`
25 25
             FROM `jpemeric_waterfall`.`county`
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     protected $connections;
12 12
 
13 13
     /**
14
-     * @param Aura\Sql\ConnectionLocator $connections
14
+     * @param ConnectionLocator $connections
15 15
      */
16 16
     public function __construct(ConnectionLocator $connections)
17 17
     {
Please login to merge, or discard this patch.
src/Domain/Waterfall/Period/MysqlPeriodRepository.php 2 patches
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 
5 5
 use Aura\Sql\ConnectionLocator;
6 6
 
7
-class MysqlPeriodRepository implements PeriodRepositoryInterface
8
-{
7
+class MysqlPeriodRepository implements PeriodRepositoryInterface
8
+{
9 9
 
10 10
     /** @var  Aura\Sql\ConnectionLocator */
11 11
     protected $connections;
@@ -13,13 +13,13 @@  discard block
 block discarded – undo
13 13
     /**
14 14
      * @param Aura\Sql\ConnectionLocator $connections
15 15
      */
16
-    public function __construct(ConnectionLocator $connections)
17
-    {
16
+    public function __construct(ConnectionLocator $connections)
17
+    {
18 18
         $this->connections = $connections;
19 19
     }
20 20
 
21
-    public function getPeriodList()
22
-    {
21
+    public function getPeriodList()
22
+    {
23 23
         $query = "
24 24
             SELECT `period`.`name`, `period`.`alias`, COUNT(1) AS `count`
25 25
             FROM `jpemeric_waterfall`.`period`
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     protected $connections;
12 12
 
13 13
     /**
14
-     * @param Aura\Sql\ConnectionLocator $connections
14
+     * @param ConnectionLocator $connections
15 15
      */
16 16
     public function __construct(ConnectionLocator $connections)
17 17
     {
Please login to merge, or discard this patch.
src/Domain/Waterfall/Companion/MysqlCompanionRepository.php 2 patches
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 
5 5
 use Aura\Sql\ConnectionLocator;
6 6
 
7
-class MysqlCompanionRepository implements CompanionRepositoryInterface
8
-{
7
+class MysqlCompanionRepository implements CompanionRepositoryInterface
8
+{
9 9
 
10 10
     /** @var  Aura\Sql\ConnectionLocator */
11 11
     protected $connections;
@@ -13,13 +13,13 @@  discard block
 block discarded – undo
13 13
     /**
14 14
      * @param Aura\Sql\ConnectionLocator $connections
15 15
      */
16
-    public function __construct(ConnectionLocator $connections)
17
-    {
16
+    public function __construct(ConnectionLocator $connections)
17
+    {
18 18
         $this->connections = $connections;
19 19
     }
20 20
 
21
-    public function getCompanionList()
22
-    {
21
+    public function getCompanionList()
22
+    {
23 23
         $query = "
24 24
             SELECT `companion`.`name`, `companion`.`alias`, COUNT(1) AS `count`
25 25
             FROM `jpemeric_waterfall`.`companion`
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     protected $connections;
12 12
 
13 13
     /**
14
-     * @param Aura\Sql\ConnectionLocator $connections
14
+     * @param ConnectionLocator $connections
15 15
      */
16 16
     public function __construct(ConnectionLocator $connections)
17 17
     {
Please login to merge, or discard this patch.
src/Domain/Waterfall/Waterfall/MysqlWaterfallRepository.php 2 patches
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 
5 5
 use Aura\Sql\ConnectionLocator;
6 6
 
7
-class MysqlWaterfallRepository implements WaterfallRepositoryInterface
8
-{
7
+class MysqlWaterfallRepository implements WaterfallRepositoryInterface
8
+{
9 9
 
10 10
     /** @var  Aura\Sql\ConnectionLocator */
11 11
     protected $connections;
@@ -13,13 +13,13 @@  discard block
 block discarded – undo
13 13
     /**
14 14
      * @param Aura\Sql\ConnectionLocator $connections
15 15
      */
16
-    public function __construct(ConnectionLocator $connections)
17
-    {
16
+    public function __construct(ConnectionLocator $connections)
17
+    {
18 18
         $this->connections = $connections;
19 19
     }
20 20
 
21
-    public function getWaterfalls($limit = null, $offset = 0)
22
-    {
21
+    public function getWaterfalls($limit = null, $offset = 0)
22
+    {
23 23
         $query = "
24 24
             SELECT `waterfall`.`id`, `waterfall`.`name`, `waterfall`.`alias`,
25 25
                    `watercourse`.`name` AS `watercourse`, `watercourse`.`alias` AS `watercourse_alias`
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     protected $connections;
12 12
 
13 13
     /**
14
-     * @param Aura\Sql\ConnectionLocator $connections
14
+     * @param ConnectionLocator $connections
15 15
      */
16 16
     public function __construct(ConnectionLocator $connections)
17 17
     {
Please login to merge, or discard this patch.
src/Domain/Waterfall/Log/MysqlLogRepository.php 2 patches
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 
5 5
 use Aura\Sql\ConnectionLocator;
6 6
 
7
-class MysqlLogRepository implements LogRepositoryInterface
8
-{
7
+class MysqlLogRepository implements LogRepositoryInterface
8
+{
9 9
 
10 10
     /** @var  Aura\Sql\ConnectionLocator */
11 11
     protected $connections;
@@ -13,13 +13,13 @@  discard block
 block discarded – undo
13 13
     /**
14 14
      * @param Aura\Sql\ConnectionLocator $connections
15 15
      */
16
-    public function __construct(ConnectionLocator $connections)
17
-    {
16
+    public function __construct(ConnectionLocator $connections)
17
+    {
18 18
         $this->connections = $connections;
19 19
     }
20 20
 
21
-    public function getActiveLogs($limit = null, $offset = 0)
22
-    {
21
+    public function getActiveLogs($limit = null, $offset = 0)
22
+    {
23 23
         $query = "
24 24
             SELECT `id`, `title`, `alias`, `date`, `publish_date`, `introduction`
25 25
             FROM `jpemeric_waterfall`.`log`
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     protected $connections;
12 12
 
13 13
     /**
14
-     * @param Aura\Sql\ConnectionLocator $connections
14
+     * @param ConnectionLocator $connections
15 15
      */
16 16
     public function __construct(ConnectionLocator $connections)
17 17
     {
Please login to merge, or discard this patch.
collector/waterfall/WaterfallCollector.class.inc.php 3 patches
Braces   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -2,11 +2,11 @@  discard block
 block discarded – undo
2 2
 
3 3
 Loader::load('collector', 'Collector');
4 4
 
5
-final class WaterfallCollector extends Collector
6
-{
5
+final class WaterfallCollector extends Collector
6
+{
7 7
 
8
-	public static function getList($total, $offset = 0)
9
-	{
8
+	public static function getList($total, $offset = 0)
9
+	{
10 10
 		$query = "
11 11
 			SELECT
12 12
 				`waterfall`.`id`,
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
 		return self::run_query($query);
44 44
 	}
45 45
 
46
-    public static function getMapList()
47
-    {
46
+    public static function getMapList()
47
+    {
48 48
         $query = "
49 49
             SELECT
50 50
                 `waterfall`.`name`,
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
         return self::run_query($query);
75 75
     }
76 76
 
77
-	public static function getListCount()
78
-	{
77
+	public static function getListCount()
78
+	{
79 79
 		$query = "
80 80
 			SELECT
81 81
 				COUNT(1) AS `count`
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
 		return self::get_count($query);
93 93
 	}
94 94
 
95
-    public static function getNearbyList($waterfall)
96
-    {
95
+    public static function getNearbyList($waterfall)
96
+    {
97 97
         $query = "
98 98
             SELECT
99 99
                 `waterfall`.`name`,
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
         return self::run_query($query);
118 118
     }
119 119
 
120
-    public static function getByOldAlias($alias)
121
-    {
120
+    public static function getByOldAlias($alias)
121
+    {
122 122
         $alias = self::escape($alias);
123 123
         
124 124
         $query = "
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 137
         return self::run_row_query($query);
138 138
     }
139 139
 
140
-	public static function getByAlias($watercourse, $waterfall)
141
-	{
140
+	public static function getByAlias($watercourse, $waterfall)
141
+	{
142 142
 		$watercourse = self::escape($watercourse);
143 143
 		$waterfall = self::escape($waterfall);
144 144
 		
Please login to merge, or discard this patch.
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@  discard block
 block discarded – undo
5 5
 final class WaterfallCollector extends Collector
6 6
 {
7 7
 
8
-	public static function getList($total, $offset = 0)
9
-	{
10
-		$query = "
8
+    public static function getList($total, $offset = 0)
9
+    {
10
+        $query = "
11 11
 			SELECT
12 12
 				`waterfall`.`id`,
13 13
 				`waterfall`.`name`,
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
 				`watercourse`.`name`
41 41
 			LIMIT
42 42
 				{$offset}, {$total}";
43
-		return self::run_query($query);
44
-	}
43
+        return self::run_query($query);
44
+    }
45 45
 
46 46
     public static function getMapList()
47 47
     {
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
         return self::run_query($query);
75 75
     }
76 76
 
77
-	public static function getListCount()
78
-	{
79
-		$query = "
77
+    public static function getListCount()
78
+    {
79
+        $query = "
80 80
 			SELECT
81 81
 				COUNT(1) AS `count`
82 82
 			FROM
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
 							ON `county`.`id` = `waterfall`.`county`
90 90
 			WHERE
91 91
 				`waterfall`.`is_public` = '1'";
92
-		return self::get_count($query);
93
-	}
92
+        return self::get_count($query);
93
+    }
94 94
 
95 95
     public static function getNearbyList($waterfall)
96 96
     {
@@ -137,12 +137,12 @@  discard block
 block discarded – undo
137 137
         return self::run_row_query($query);
138 138
     }
139 139
 
140
-	public static function getByAlias($watercourse, $waterfall)
141
-	{
142
-		$watercourse = self::escape($watercourse);
143
-		$waterfall = self::escape($waterfall);
140
+    public static function getByAlias($watercourse, $waterfall)
141
+    {
142
+        $watercourse = self::escape($watercourse);
143
+        $waterfall = self::escape($waterfall);
144 144
 		
145
-		$query = "
145
+        $query = "
146 146
 			SELECT
147 147
 				`waterfall`.`id` AS `id`,
148 148
 				`waterfall`.`name`,
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 				`waterfall`.`is_public` = '1'
193 193
 			LIMIT 1";
194 194
 		
195
-		return self::run_row_query($query);
196
-	}
195
+        return self::run_row_query($query);
196
+    }
197 197
 
198 198
 }
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -117,6 +117,9 @@
 block discarded – undo
117 117
         return self::run_query($query);
118 118
     }
119 119
 
120
+    /**
121
+     * @param string $alias
122
+     */
120 123
     public static function getByOldAlias($alias)
121 124
     {
122 125
         $alias = self::escape($alias);
Please login to merge, or discard this patch.
controller/PageController.class.inc.php 4 patches
Doc Comments   +31 added lines patch added patch discarded remove patch
@@ -113,6 +113,9 @@  discard block
 block discarded – undo
113 113
 			exit;
114 114
 	}
115 115
 
116
+	/**
117
+	 * @param string $method
118
+	 */
116 119
 	protected function set_header_method($method)
117 120
 	{
118 121
 		$this->headers = $method;
@@ -123,6 +126,9 @@  discard block
 block discarded – undo
123 126
 		$this->set_head('title', $value);
124 127
 	}
125 128
 
129
+	/**
130
+	 * @param string $value
131
+	 */
126 132
 	protected function set_author($value)
127 133
 	{
128 134
 		$this->set_head('author', $value);
@@ -138,26 +144,41 @@  discard block
 block discarded – undo
138 144
 		$this->set_head('keywords', implode(', ', $array));
139 145
 	}
140 146
 	
147
+	/**
148
+	 * @param string $url
149
+	 */
141 150
 	protected function set_canonical($url)
142 151
 	{
143 152
 		$this->set_head('canonical', $url);
144 153
 	}
145 154
 
155
+	/**
156
+	 * @param string $set
157
+	 */
146 158
 	protected function set_head($set, $value)
147 159
 	{
148 160
 		$this->data_array['head'][$set] = $value;
149 161
 	}
150 162
 
163
+	/**
164
+	 * @param string $set
165
+	 */
151 166
 	protected function set_body($set, $value)
152 167
 	{
153 168
 		$this->data_array['body'][$set] = $value;
154 169
 	}
155 170
 
171
+	/**
172
+	 * @param string $file
173
+	 */
156 174
 	protected function add_css($file, $version = 1)
157 175
 	{
158 176
 		$this->css_array[] = [$file, $version];
159 177
 	}
160 178
 
179
+	/**
180
+	 * @param string $file
181
+	 */
161 182
 	protected function add_js($file)
162 183
 	{
163 184
 		$this->js_array[] = $file;
@@ -183,6 +204,9 @@  discard block
 block discarded – undo
183 204
 		$this->set_head('js_link_array', $js_array);
184 205
 	}
185 206
 
207
+	/**
208
+	 * @param string $view
209
+	 */
186 210
 	protected function set_body_view($view)
187 211
 	{
188 212
 		$this->body_view_array[] = $view;
@@ -227,6 +251,10 @@  discard block
 block discarded – undo
227 251
 	}
228 252
 
229 253
 	private $comment_errors;
254
+
255
+	/**
256
+	 * @param string $redirect_url
257
+	 */
230 258
 	protected function handle_comment_submit($site_id, $path, $redirect_url, $page_title)
231 259
 	{
232 260
 		if(Request::hasPost() && Request::getPost('submit') == 'Submit Comment')
@@ -238,6 +266,9 @@  discard block
 block discarded – undo
238 266
 		return;
239 267
 	}
240 268
 
269
+    /**
270
+     * @param string $site
271
+     */
241 272
     protected function get_comment_array($site, $path)
242 273
     {
243 274
         global $container;
Please login to merge, or discard this patch.
Indentation   +174 added lines, -174 removed lines patch added patch discarded remove patch
@@ -5,52 +5,52 @@  discard block
 block discarded – undo
5 5
 abstract class PageController
6 6
 {
7 7
 
8
-	private static $TRACKING_CODE = 'UA-11745070-1';
8
+    private static $TRACKING_CODE = 'UA-11745070-1';
9 9
 	
10
-	protected static $DEPRECATED_BLOGS = array(
11
-		10 => 63,
12
-		55 => 67,
13
-	);
14
-
15
-	private $headers;
16
-	private $css_array = array();
17
-	private $font_css_array = array();
18
-	private $js_array = array();
19
-
20
-	private $data_array = array();
21
-	private $body_view_array = array();
22
-
23
-	protected function set_head_data() {}
24
-	protected function set_body_data() {}
25
-	protected function set_data() {}
26
-
27
-	public function __construct()
28
-	{
29
-		$this->set_header_method('sendHTML');
10
+    protected static $DEPRECATED_BLOGS = array(
11
+        10 => 63,
12
+        55 => 67,
13
+    );
14
+
15
+    private $headers;
16
+    private $css_array = array();
17
+    private $font_css_array = array();
18
+    private $js_array = array();
19
+
20
+    private $data_array = array();
21
+    private $body_view_array = array();
22
+
23
+    protected function set_head_data() {}
24
+    protected function set_body_data() {}
25
+    protected function set_data() {}
26
+
27
+    public function __construct()
28
+    {
29
+        $this->set_header_method('sendHTML');
30 30
 		
31
-		$this->set_head('google_verification', 'sgAISiuoWfK54KXnOfm2oU4vQdad8eyNCQX7LkZ1OxM');
32
-		$this->set_head('bing_verification', 'AF1A4CEA30A7589590E9294C4B512607');
31
+        $this->set_head('google_verification', 'sgAISiuoWfK54KXnOfm2oU4vQdad8eyNCQX7LkZ1OxM');
32
+        $this->set_head('bing_verification', 'AF1A4CEA30A7589590E9294C4B512607');
33 33
 		
34
-		$this->set_body('domain_container', $this->get_domain_container());
35
-		$this->set_body('footer', array(
36
-			'link' => Loader::getRootUrl('site'),
37
-			'anchor' => 'jacobemerick.com',
38
-			'date' => date('Y')));
39
-	}
40
-
41
-	protected function get_domain_container()
42
-	{
43
-		$domain_container = new stdclass();
34
+        $this->set_body('domain_container', $this->get_domain_container());
35
+        $this->set_body('footer', array(
36
+            'link' => Loader::getRootUrl('site'),
37
+            'anchor' => 'jacobemerick.com',
38
+            'date' => date('Y')));
39
+    }
40
+
41
+    protected function get_domain_container()
42
+    {
43
+        $domain_container = new stdclass();
44 44
 		
45
-		$domain_container->blog = Loader::getRootUrl('blog');
46
-		$domain_container->home = Loader::getRootUrl('home');
47
-		$domain_container->lifestream = Loader::getRootUrl('lifestream');
48
-		$domain_container->map = Loader::getRootUrl('map');
49
-		$domain_container->portfolio = Loader::getRootUrl('portfolio');
50
-		$domain_container->waterfalls = Loader::getRootUrl('waterfalls');
45
+        $domain_container->blog = Loader::getRootUrl('blog');
46
+        $domain_container->home = Loader::getRootUrl('home');
47
+        $domain_container->lifestream = Loader::getRootUrl('lifestream');
48
+        $domain_container->map = Loader::getRootUrl('map');
49
+        $domain_container->portfolio = Loader::getRootUrl('portfolio');
50
+        $domain_container->waterfalls = Loader::getRootUrl('waterfalls');
51 51
 		
52
-		return $domain_container;
53
-	}
52
+        return $domain_container;
53
+    }
54 54
 
55 55
     protected function get_recent_activity()
56 56
     {
@@ -84,24 +84,24 @@  discard block
 block discarded – undo
84 84
         return (object) $post;
85 85
     }
86 86
 
87
-	public function activate()
88
-	{
89
-		$this->set_head_data();
90
-		$this->set_body_data();
91
-		$this->set_data();
87
+    public function activate()
88
+    {
89
+        $this->set_head_data();
90
+        $this->set_body_data();
91
+        $this->set_data();
92 92
 		
93
-		$this->load_assets();
93
+        $this->load_assets();
94 94
 		
95
-		$headers = $this->headers;
96
-		Header::$headers();
97
-		Loader::load('view', '/Head', $this->data_array['head']);
98
-		foreach($this->body_view_array as $view)
99
-		{
100
-			if(substr($view, 0, 1) == '/')
101
-				Loader::load('view', $view, $this->data_array['body']);
102
-			else
103
-				Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']);
104
-		}
95
+        $headers = $this->headers;
96
+        Header::$headers();
97
+        Loader::load('view', '/Head', $this->data_array['head']);
98
+        foreach($this->body_view_array as $view)
99
+        {
100
+            if(substr($view, 0, 1) == '/')
101
+                Loader::load('view', $view, $this->data_array['body']);
102
+            else
103
+                Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']);
104
+        }
105 105
         
106 106
         if (URLDecode::getSite() == 'waterfalls') {
107 107
             Loader::load('view', '/WaterfallFoot');
@@ -109,134 +109,134 @@  discard block
 block discarded – undo
109 109
             Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE));
110 110
         }
111 111
 		
112
-		if($view == '/404' || $view == '/503')
113
-			exit;
114
-	}
115
-
116
-	protected function set_header_method($method)
117
-	{
118
-		$this->headers = $method;
119
-	}
120
-
121
-	protected function set_title($value)
122
-	{
123
-		$this->set_head('title', $value);
124
-	}
125
-
126
-	protected function set_author($value)
127
-	{
128
-		$this->set_head('author', $value);
129
-	}
130
-
131
-	protected function set_description($value)
132
-	{
133
-		$this->set_head('description', $value);
134
-	}
135
-
136
-	protected function set_keywords($array)
137
-	{
138
-		$this->set_head('keywords', implode(', ', $array));
139
-	}
112
+        if($view == '/404' || $view == '/503')
113
+            exit;
114
+    }
115
+
116
+    protected function set_header_method($method)
117
+    {
118
+        $this->headers = $method;
119
+    }
120
+
121
+    protected function set_title($value)
122
+    {
123
+        $this->set_head('title', $value);
124
+    }
125
+
126
+    protected function set_author($value)
127
+    {
128
+        $this->set_head('author', $value);
129
+    }
130
+
131
+    protected function set_description($value)
132
+    {
133
+        $this->set_head('description', $value);
134
+    }
135
+
136
+    protected function set_keywords($array)
137
+    {
138
+        $this->set_head('keywords', implode(', ', $array));
139
+    }
140 140
 	
141
-	protected function set_canonical($url)
142
-	{
143
-		$this->set_head('canonical', $url);
144
-	}
145
-
146
-	protected function set_head($set, $value)
147
-	{
148
-		$this->data_array['head'][$set] = $value;
149
-	}
150
-
151
-	protected function set_body($set, $value)
152
-	{
153
-		$this->data_array['body'][$set] = $value;
154
-	}
155
-
156
-	protected function add_css($file, $version = 1)
157
-	{
158
-		$this->css_array[] = [$file, $version];
159
-	}
160
-
161
-	protected function add_js($file)
162
-	{
163
-		$this->js_array[] = $file;
164
-	}
165
-
166
-	private function load_assets()
167
-	{
141
+    protected function set_canonical($url)
142
+    {
143
+        $this->set_head('canonical', $url);
144
+    }
145
+
146
+    protected function set_head($set, $value)
147
+    {
148
+        $this->data_array['head'][$set] = $value;
149
+    }
150
+
151
+    protected function set_body($set, $value)
152
+    {
153
+        $this->data_array['body'][$set] = $value;
154
+    }
155
+
156
+    protected function add_css($file, $version = 1)
157
+    {
158
+        $this->css_array[] = [$file, $version];
159
+    }
160
+
161
+    protected function add_js($file)
162
+    {
163
+        $this->js_array[] = $file;
164
+    }
165
+
166
+    private function load_assets()
167
+    {
168 168
     $css_array = array_map(function ($stylesheet) {
169
-      $path = "/css/{$stylesheet[0]}.css";
170
-      if ($stylesheet[1] > 1) {
169
+        $path = "/css/{$stylesheet[0]}.css";
170
+        if ($stylesheet[1] > 1) {
171 171
         $path .= "?v={$stylesheet[1]}";
172
-      }
173
-      return $path;
172
+        }
173
+        return $path;
174 174
     }, $this->css_array);
175 175
     $js_array = array_map(function ($script) {
176
-      if (substr($script, 0, 4) == 'http') {
176
+        if (substr($script, 0, 4) == 'http') {
177 177
         return $script;
178
-      }
179
-      return "/js/{$script}.min.js";
178
+        }
179
+        return "/js/{$script}.min.js";
180 180
     }, $this->js_array);
181 181
 		
182
-		$this->set_head('css_link_array', $css_array);
183
-		$this->set_head('js_link_array', $js_array);
184
-	}
185
-
186
-	protected function set_body_view($view)
187
-	{
188
-		$this->body_view_array[] = $view;
189
-	}
190
-
191
-	protected function eject()
192
-	{
193
-		if(get_class($this) !== 'Error404Controller')
194
-			Loader::loadNew('controller', '/Error404Controller')->activate();
195
-	}
196
-
197
-	protected function unavailable()
198
-	{
199
-		if(get_class($this) !== 'Error503Controller')
200
-			Loader::loadNew('controller', '/Error503Controller')->activate();
201
-	}
202
-
203
-	protected function redirect($uri, $method = 301)
204
-	{
205
-		switch($method)
206
-		{
207
-			case 301 :
208
-				if(get_class($this) !== 'Error301Controller')
209
-					Loader::loadNew('controller', '/Error301Controller', array($uri))->activate();
210
-				break;
211
-			case 303 :
212
-				if(get_class($this) !== 'Error303Controller')
213
-					Loader::loadNew('controller', '/Error303Controller', array($uri))->activate();
214
-				break;
215
-		}
216
-	}
217
-
218
-	final protected function get_parsed_date($date)
219
-	{
220
-		$parsed_date = new stdclass();
182
+        $this->set_head('css_link_array', $css_array);
183
+        $this->set_head('js_link_array', $js_array);
184
+    }
185
+
186
+    protected function set_body_view($view)
187
+    {
188
+        $this->body_view_array[] = $view;
189
+    }
190
+
191
+    protected function eject()
192
+    {
193
+        if(get_class($this) !== 'Error404Controller')
194
+            Loader::loadNew('controller', '/Error404Controller')->activate();
195
+    }
196
+
197
+    protected function unavailable()
198
+    {
199
+        if(get_class($this) !== 'Error503Controller')
200
+            Loader::loadNew('controller', '/Error503Controller')->activate();
201
+    }
202
+
203
+    protected function redirect($uri, $method = 301)
204
+    {
205
+        switch($method)
206
+        {
207
+            case 301 :
208
+                if(get_class($this) !== 'Error301Controller')
209
+                    Loader::loadNew('controller', '/Error301Controller', array($uri))->activate();
210
+                break;
211
+            case 303 :
212
+                if(get_class($this) !== 'Error303Controller')
213
+                    Loader::loadNew('controller', '/Error303Controller', array($uri))->activate();
214
+                break;
215
+        }
216
+    }
217
+
218
+    final protected function get_parsed_date($date)
219
+    {
220
+        $parsed_date = new stdclass();
221 221
 		
222
-		$parsed_date->stamp = date('c', strtotime($date));
223
-		$parsed_date->friendly = date('F j, Y', strtotime($date));
224
-		$parsed_date->elapsed = Content::instance('ElapsedTime', $date)->activate();
222
+        $parsed_date->stamp = date('c', strtotime($date));
223
+        $parsed_date->friendly = date('F j, Y', strtotime($date));
224
+        $parsed_date->elapsed = Content::instance('ElapsedTime', $date)->activate();
225 225
 		
226
-		return $parsed_date;
227
-	}
228
-
229
-	private $comment_errors;
230
-	protected function handle_comment_submit($site_id, $path, $redirect_url, $page_title)
231
-	{
232
-		if(Request::hasPost() && Request::getPost('submit') == 'Submit Comment')
233
-		{
234
-			$parameters = array($site_id, $path, $redirect_url, $page_title);
235
-			$this->comment_errors = Loader::loadNew('module', 'form/CommentSubmitModule', $parameters)->activate();
236
-		}
226
+        return $parsed_date;
227
+    }
228
+
229
+    private $comment_errors;
230
+    protected function handle_comment_submit($site_id, $path, $redirect_url, $page_title)
231
+    {
232
+        if(Request::hasPost() && Request::getPost('submit') == 'Submit Comment')
233
+        {
234
+            $parameters = array($site_id, $path, $redirect_url, $page_title);
235
+            $this->comment_errors = Loader::loadNew('module', 'form/CommentSubmitModule', $parameters)->activate();
236
+        }
237 237
 		
238
-		return;
239
-	}
238
+        return;
239
+    }
240 240
 
241 241
     protected function get_comment_array($site, $path)
242 242
     {
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $post_result = $activityRepository->getActivities(5);
60 60
 
61 61
         $post_array = array();
62
-        foreach($post_result as $row) {
62
+        foreach ($post_result as $row) {
63 63
             array_push($post_array, $this->expand_post($row));
64 64
         }
65 65
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         ];
76 76
 
77 77
         if ($format != 'short') {
78
-            $post['url'] = Loader::getRootUrl('lifestream') . "{$raw_post['type']}/{$raw_post['id']}/";
78
+            $post['url'] = Loader::getRootUrl('lifestream')."{$raw_post['type']}/{$raw_post['id']}/";
79 79
 
80 80
             $metadata = json_decode($raw_post['metadata'], true);
81 81
             $post = array_merge($post, $metadata);
@@ -95,12 +95,12 @@  discard block
 block discarded – undo
95 95
 		$headers = $this->headers;
96 96
 		Header::$headers();
97 97
 		Loader::load('view', '/Head', $this->data_array['head']);
98
-		foreach($this->body_view_array as $view)
98
+		foreach ($this->body_view_array as $view)
99 99
 		{
100
-			if(substr($view, 0, 1) == '/')
100
+			if (substr($view, 0, 1) == '/')
101 101
 				Loader::load('view', $view, $this->data_array['body']);
102 102
 			else
103
-				Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']);
103
+				Loader::load('view', URLDecode::getSite().'/'.$view, $this->data_array['body']);
104 104
 		}
105 105
         
106 106
         if (URLDecode::getSite() == 'waterfalls') {
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
             Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE));
110 110
         }
111 111
 		
112
-		if($view == '/404' || $view == '/503')
112
+		if ($view == '/404' || $view == '/503')
113 113
 			exit;
114 114
 	}
115 115
 
@@ -165,14 +165,14 @@  discard block
 block discarded – undo
165 165
 
166 166
 	private function load_assets()
167 167
 	{
168
-    $css_array = array_map(function ($stylesheet) {
168
+    $css_array = array_map(function($stylesheet) {
169 169
       $path = "/css/{$stylesheet[0]}.css";
170 170
       if ($stylesheet[1] > 1) {
171 171
         $path .= "?v={$stylesheet[1]}";
172 172
       }
173 173
       return $path;
174 174
     }, $this->css_array);
175
-    $js_array = array_map(function ($script) {
175
+    $js_array = array_map(function($script) {
176 176
       if (substr($script, 0, 4) == 'http') {
177 177
         return $script;
178 178
       }
@@ -190,26 +190,26 @@  discard block
 block discarded – undo
190 190
 
191 191
 	protected function eject()
192 192
 	{
193
-		if(get_class($this) !== 'Error404Controller')
193
+		if (get_class($this) !== 'Error404Controller')
194 194
 			Loader::loadNew('controller', '/Error404Controller')->activate();
195 195
 	}
196 196
 
197 197
 	protected function unavailable()
198 198
 	{
199
-		if(get_class($this) !== 'Error503Controller')
199
+		if (get_class($this) !== 'Error503Controller')
200 200
 			Loader::loadNew('controller', '/Error503Controller')->activate();
201 201
 	}
202 202
 
203 203
 	protected function redirect($uri, $method = 301)
204 204
 	{
205
-		switch($method)
205
+		switch ($method)
206 206
 		{
207 207
 			case 301 :
208
-				if(get_class($this) !== 'Error301Controller')
208
+				if (get_class($this) !== 'Error301Controller')
209 209
 					Loader::loadNew('controller', '/Error301Controller', array($uri))->activate();
210 210
 				break;
211 211
 			case 303 :
212
-				if(get_class($this) !== 'Error303Controller')
212
+				if (get_class($this) !== 'Error303Controller')
213 213
 					Loader::loadNew('controller', '/Error303Controller', array($uri))->activate();
214 214
 				break;
215 215
 		}
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	private $comment_errors;
230 230
 	protected function handle_comment_submit($site_id, $path, $redirect_url, $page_title)
231 231
 	{
232
-		if(Request::hasPost() && Request::getPost('submit') == 'Submit Comment')
232
+		if (Request::hasPost() && Request::getPost('submit') == 'Submit Comment')
233 233
 		{
234 234
 			$parameters = array($site_id, $path, $redirect_url, $page_title);
235 235
 			$this->comment_errors = Loader::loadNew('module', 'form/CommentSubmitModule', $parameters)->activate();
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
         $container['logger']->info("CommentService | Path | {$elapsed}");
262 262
 
263 263
         $array = array();
264
-        foreach((array) $comment_response as $comment)
264
+        foreach ((array) $comment_response as $comment)
265 265
         {
266 266
             $body = Content::instance('CleanComment', $comment['body'])->activate();
267 267
             $body = strip_tags($body);
Please login to merge, or discard this patch.
Braces   +77 added lines, -65 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 
3 3
 Loader::load('utility', 'Header');
4 4
 
5
-abstract class PageController
6
-{
5
+abstract class PageController
6
+{
7 7
 
8 8
 	private static $TRACKING_CODE = 'UA-11745070-1';
9 9
 	
@@ -20,12 +20,18 @@  discard block
 block discarded – undo
20 20
 	private $data_array = array();
21 21
 	private $body_view_array = array();
22 22
 
23
-	protected function set_head_data() {}
24
-	protected function set_body_data() {}
25
-	protected function set_data() {}
23
+	protected function set_head_data()
24
+	{
25
+}
26
+	protected function set_body_data()
27
+	{
28
+}
29
+	protected function set_data()
30
+	{
31
+}
26 32
 
27
-	public function __construct()
28
-	{
33
+	public function __construct()
34
+	{
29 35
 		$this->set_header_method('sendHTML');
30 36
 		
31 37
 		$this->set_head('google_verification', 'sgAISiuoWfK54KXnOfm2oU4vQdad8eyNCQX7LkZ1OxM');
@@ -38,8 +44,8 @@  discard block
 block discarded – undo
38 44
 			'date' => date('Y')));
39 45
 	}
40 46
 
41
-	protected function get_domain_container()
42
-	{
47
+	protected function get_domain_container()
48
+	{
43 49
 		$domain_container = new stdclass();
44 50
 		
45 51
 		$domain_container->blog = Loader::getRootUrl('blog');
@@ -52,8 +58,8 @@  discard block
 block discarded – undo
52 58
 		return $domain_container;
53 59
 	}
54 60
 
55
-    protected function get_recent_activity()
56
-    {
61
+    protected function get_recent_activity()
62
+    {
57 63
         global $container;
58 64
         $activityRepository = new Jacobemerick\Web\Domain\Stream\Activity\MysqlActivityRepository($container['db_connection_locator']);
59 65
         $post_result = $activityRepository->getActivities(5);
@@ -66,8 +72,8 @@  discard block
 block discarded – undo
66 72
         return $post_array;
67 73
     }
68 74
 
69
-    protected function expand_post($raw_post, $format = 'short')
70
-    {
75
+    protected function expand_post($raw_post, $format = 'short')
76
+    {
71 77
         $post = [
72 78
             'type' => $raw_post['type'],
73 79
             'title' => ($format == 'short') ? $raw_post['message'] : $raw_post['message_long'],
@@ -84,8 +90,8 @@  discard block
 block discarded – undo
84 90
         return (object) $post;
85 91
     }
86 92
 
87
-	public function activate()
88
-	{
93
+	public function activate()
94
+	{
89 95
 		$this->set_head_data();
90 96
 		$this->set_body_data();
91 97
 		$this->set_data();
@@ -97,10 +103,11 @@  discard block
 block discarded – undo
97 103
 		Loader::load('view', '/Head', $this->data_array['head']);
98 104
 		foreach($this->body_view_array as $view)
99 105
 		{
100
-			if(substr($view, 0, 1) == '/')
101
-				Loader::load('view', $view, $this->data_array['body']);
102
-			else
103
-				Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']);
106
+			if(substr($view, 0, 1) == '/') {
107
+							Loader::load('view', $view, $this->data_array['body']);
108
+			} else {
109
+							Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']);
110
+			}
104 111
 		}
105 112
         
106 113
         if (URLDecode::getSite() == 'waterfalls') {
@@ -109,62 +116,63 @@  discard block
 block discarded – undo
109 116
             Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE));
110 117
         }
111 118
 		
112
-		if($view == '/404' || $view == '/503')
113
-			exit;
119
+		if($view == '/404' || $view == '/503') {
120
+					exit;
121
+		}
114 122
 	}
115 123
 
116
-	protected function set_header_method($method)
117
-	{
124
+	protected function set_header_method($method)
125
+	{
118 126
 		$this->headers = $method;
119 127
 	}
120 128
 
121
-	protected function set_title($value)
122
-	{
129
+	protected function set_title($value)
130
+	{
123 131
 		$this->set_head('title', $value);
124 132
 	}
125 133
 
126
-	protected function set_author($value)
127
-	{
134
+	protected function set_author($value)
135
+	{
128 136
 		$this->set_head('author', $value);
129 137
 	}
130 138
 
131
-	protected function set_description($value)
132
-	{
139
+	protected function set_description($value)
140
+	{
133 141
 		$this->set_head('description', $value);
134 142
 	}
135 143
 
136
-	protected function set_keywords($array)
137
-	{
144
+	protected function set_keywords($array)
145
+	{
138 146
 		$this->set_head('keywords', implode(', ', $array));
139 147
 	}
140 148
 	
141
-	protected function set_canonical($url)
142
-	{
149
+	protected function set_canonical($url)
150
+	{
143 151
 		$this->set_head('canonical', $url);
144 152
 	}
145 153
 
146
-	protected function set_head($set, $value)
147
-	{
154
+	protected function set_head($set, $value)
155
+	{
148 156
 		$this->data_array['head'][$set] = $value;
149 157
 	}
150 158
 
151
-	protected function set_body($set, $value)
152
-	{
159
+	protected function set_body($set, $value)
160
+	{
153 161
 		$this->data_array['body'][$set] = $value;
154 162
 	}
155 163
 
156
-	protected function add_css($file, $version = 1)
157
-	{
164
+	protected function add_css($file, $version = 1)
165
+	{
158 166
 		$this->css_array[] = [$file, $version];
159 167
 	}
160 168
 
161
-	protected function add_js($file)
162
-	{
169
+	protected function add_js($file)
170
+	{
163 171
 		$this->js_array[] = $file;
164 172
 	}
165 173
 
166
-	private function load_assets()
167
-	{
174
+	private function load_assets()
175
+	{
168 176
     $css_array = array_map(function ($stylesheet) {
169 177
       $path = "/css/{$stylesheet[0]}.css";
170 178
       if ($stylesheet[1] > 1) {
@@ -183,40 +191,44 @@  discard block
 block discarded – undo
183 191
 		$this->set_head('js_link_array', $js_array);
184 192
 	}
185 193
 
186
-	protected function set_body_view($view)
187
-	{
194
+	protected function set_body_view($view)
195
+	{
188 196
 		$this->body_view_array[] = $view;
189 197
 	}
190 198
 
191
-	protected function eject()
192
-	{
193
-		if(get_class($this) !== 'Error404Controller')
194
-			Loader::loadNew('controller', '/Error404Controller')->activate();
199
+	protected function eject()
200
+	{
201
+		if(get_class($this) !== 'Error404Controller') {
202
+					Loader::loadNew('controller', '/Error404Controller')->activate();
203
+		}
195 204
 	}
196 205
 
197
-	protected function unavailable()
198
-	{
199
-		if(get_class($this) !== 'Error503Controller')
200
-			Loader::loadNew('controller', '/Error503Controller')->activate();
206
+	protected function unavailable()
207
+	{
208
+		if(get_class($this) !== 'Error503Controller') {
209
+					Loader::loadNew('controller', '/Error503Controller')->activate();
210
+		}
201 211
 	}
202 212
 
203
-	protected function redirect($uri, $method = 301)
204
-	{
213
+	protected function redirect($uri, $method = 301)
214
+	{
205 215
 		switch($method)
206 216
 		{
207 217
 			case 301 :
208
-				if(get_class($this) !== 'Error301Controller')
209
-					Loader::loadNew('controller', '/Error301Controller', array($uri))->activate();
218
+				if(get_class($this) !== 'Error301Controller') {
219
+									Loader::loadNew('controller', '/Error301Controller', array($uri))->activate();
220
+				}
210 221
 				break;
211 222
 			case 303 :
212
-				if(get_class($this) !== 'Error303Controller')
213
-					Loader::loadNew('controller', '/Error303Controller', array($uri))->activate();
223
+				if(get_class($this) !== 'Error303Controller') {
224
+									Loader::loadNew('controller', '/Error303Controller', array($uri))->activate();
225
+				}
214 226
 				break;
215 227
 		}
216 228
 	}
217 229
 
218
-	final protected function get_parsed_date($date)
219
-	{
230
+	final protected function get_parsed_date($date)
231
+	{
220 232
 		$parsed_date = new stdclass();
221 233
 		
222 234
 		$parsed_date->stamp = date('c', strtotime($date));
@@ -227,8 +239,8 @@  discard block
 block discarded – undo
227 239
 	}
228 240
 
229 241
 	private $comment_errors;
230
-	protected function handle_comment_submit($site_id, $path, $redirect_url, $page_title)
231
-	{
242
+	protected function handle_comment_submit($site_id, $path, $redirect_url, $page_title)
243
+	{
232 244
 		if(Request::hasPost() && Request::getPost('submit') == 'Submit Comment')
233 245
 		{
234 246
 			$parameters = array($site_id, $path, $redirect_url, $page_title);
@@ -238,8 +250,8 @@  discard block
 block discarded – undo
238 250
 		return;
239 251
 	}
240 252
 
241
-    protected function get_comment_array($site, $path)
242
-    {
253
+    protected function get_comment_array($site, $path)
254
+    {
243 255
         global $container;
244 256
         $repository = new Jacobemerick\Web\Domain\Comment\Comment\ServiceCommentRepository($container['comment_service_api']);
245 257
         $start = microtime(true);
Please login to merge, or discard this patch.
controller/blog/DefaultPageController.class.inc.php 4 patches
Indentation   +113 added lines, -113 removed lines patch added patch discarded remove patch
@@ -6,150 +6,150 @@
 block discarded – undo
6 6
 abstract class DefaultPageController extends PageController
7 7
 {
8 8
 
9
-	private static $RECENT_COMMENT_COUNT = 10;
10
-	private static $MINIMUM_TAG_COUNT = 10;
11
-	protected static $LENGTH_OF_TRIMMED_POST = 300;
9
+    private static $RECENT_COMMENT_COUNT = 10;
10
+    private static $MINIMUM_TAG_COUNT = 10;
11
+    protected static $LENGTH_OF_TRIMMED_POST = 300;
12 12
 
13
-	protected static $BLOG_SITE_ID = 2;
13
+    protected static $BLOG_SITE_ID = 2;
14 14
 
15
-	private static $INTRODUCTION_IMAGE_PATTERN = '<img src="/photo/%s/%s-size-%s.jpg" height="%d" width="%d" alt="%s" />';
15
+    private static $INTRODUCTION_IMAGE_PATTERN = '<img src="/photo/%s/%s-size-%s.jpg" height="%d" width="%d" alt="%s" />';
16 16
 
17
-	protected function set_head_data()
18
-	{
17
+    protected function set_head_data()
18
+    {
19 19
     $this->set_head('rss_link', [
20
-      'title' => 'Jacob Emerick Blog Feed',
21
-      'url' => '/rss.xml'
20
+        'title' => 'Jacob Emerick Blog Feed',
21
+        'url' => '/rss.xml'
22 22
     ]);
23 23
     $this->set_head('rss_comment_link', [
24
-      'title' => 'Jacob Emerick Blog Comment Feed',
25
-      'url' => '/rss-comments.xml'
24
+        'title' => 'Jacob Emerick Blog Comment Feed',
25
+        'url' => '/rss-comments.xml'
26 26
     ]);
27 27
 		
28
-		$this->add_css('normalize');
29
-		$this->add_css('blog');
30
-	}
31
-
32
-	protected function get_introduction()
33
-	{
34
-		return;
35
-	}
36
-
37
-	protected function get_introduction_image($id)
38
-	{
39
-		Loader::load('collector', 'image/PhotoCollector');
40
-		$photo_result = PhotoCollector::getRow($id);
28
+        $this->add_css('normalize');
29
+        $this->add_css('blog');
30
+    }
31
+
32
+    protected function get_introduction()
33
+    {
34
+        return;
35
+    }
36
+
37
+    protected function get_introduction_image($id)
38
+    {
39
+        Loader::load('collector', 'image/PhotoCollector');
40
+        $photo_result = PhotoCollector::getRow($id);
41 41
 		
42
-		if($photo_result == null)
43
-			return;
42
+        if($photo_result == null)
43
+            return;
44 44
 		
45
-		$name = $photo_result->name;
46
-		$category = $photo_result->category;
47
-		$size = 'medium';
48
-		$height = 375;
49
-		$width = 500;
50
-		$description = $photo_result->description;
45
+        $name = $photo_result->name;
46
+        $category = $photo_result->category;
47
+        $size = 'medium';
48
+        $height = 375;
49
+        $width = 500;
50
+        $description = $photo_result->description;
51 51
 		
52
-		return sprintf(self::$INTRODUCTION_IMAGE_PATTERN, $category, $name, $size, $height, $width, $description);
53
-	}
54
-
55
-	protected function set_body_data()
56
-	{
57
-		$this->set_body('introduction', $this->get_introduction());
58
-		$this->set_body('right_side', $this->get_right_side());
59
-		$this->set_body('activity_array', $this->get_recent_activity());
52
+        return sprintf(self::$INTRODUCTION_IMAGE_PATTERN, $category, $name, $size, $height, $width, $description);
53
+    }
54
+
55
+    protected function set_body_data()
56
+    {
57
+        $this->set_body('introduction', $this->get_introduction());
58
+        $this->set_body('right_side', $this->get_right_side());
59
+        $this->set_body('activity_array', $this->get_recent_activity());
60 60
 		
61
-		$this->set_body_view('Page');
62
-	}
61
+        $this->set_body_view('Page');
62
+    }
63 63
 
64
-	final protected function format_post($post, $trim = false)
65
-	{
66
-		$post_object = new stdclass();
64
+    final protected function format_post($post, $trim = false)
65
+    {
66
+        $post_object = new stdclass();
67 67
 		
68
-		$post_object->title = $post['title'];
69
-		$post_object->path = "/{$post['category']}/{$post['path']}/";
70
-		$post_object->category = ucwords(str_replace('-', ' ', $post['category']));
71
-		$post_object->category_link = "/{$post['category']}/";
72
-		$post_object->tags = $this->get_tags_for_post($post);
73
-		$post_object->image = Content::instance('FetchFirstPhoto', $post['body'])->activate(false, 'small');
74
-		$post_object->body = $this->get_body_for_post($post, $trim);
75
-		$post_object->date = $this->get_parsed_date($post['date']);
76
-
77
-		return $post_object;
78
-	}
79
-
80
-	final private function get_tags_for_post($post)
81
-	{
68
+        $post_object->title = $post['title'];
69
+        $post_object->path = "/{$post['category']}/{$post['path']}/";
70
+        $post_object->category = ucwords(str_replace('-', ' ', $post['category']));
71
+        $post_object->category_link = "/{$post['category']}/";
72
+        $post_object->tags = $this->get_tags_for_post($post);
73
+        $post_object->image = Content::instance('FetchFirstPhoto', $post['body'])->activate(false, 'small');
74
+        $post_object->body = $this->get_body_for_post($post, $trim);
75
+        $post_object->date = $this->get_parsed_date($post['date']);
76
+
77
+        return $post_object;
78
+    }
79
+
80
+    final private function get_tags_for_post($post)
81
+    {
82 82
         global $container;
83 83
         $repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']);
84 84
         $tag_result = $repository->getTagsForPost($post['id']);
85 85
 
86 86
         $tag_array = array();
87
-		foreach($tag_result as $tag)
88
-		{
89
-			$tag_object = new stdclass();
90
-			$tag_object->name = $tag['tag'];
91
-			$tag_object->link = Content::instance('URLSafe', "/tag/{$tag['tag']}/")->activate();
92
-			$tag_array[] = $tag_object;
93
-		}
94
-		return $tag_array;
95
-	}
96
-
97
-	final private function get_body_for_post($post, $trim)
98
-	{
99
-		$body = $post['body'];
87
+        foreach($tag_result as $tag)
88
+        {
89
+            $tag_object = new stdclass();
90
+            $tag_object->name = $tag['tag'];
91
+            $tag_object->link = Content::instance('URLSafe', "/tag/{$tag['tag']}/")->activate();
92
+            $tag_array[] = $tag_object;
93
+        }
94
+        return $tag_array;
95
+    }
96
+
97
+    final private function get_body_for_post($post, $trim)
98
+    {
99
+        $body = $post['body'];
100 100
 		
101
-		if($trim)
102
-			$body = Content::instance('SmartTrim', $body)->activate(self::$LENGTH_OF_TRIMMED_POST);
101
+        if($trim)
102
+            $body = Content::instance('SmartTrim', $body)->activate(self::$LENGTH_OF_TRIMMED_POST);
103 103
 		
104
-		$body = Content::instance('FixPhoto', $body)->activate(false, 'standard');
105
-		$body = Content::instance('MarkupCode', $body)->activate();
104
+        $body = Content::instance('FixPhoto', $body)->activate(false, 'standard');
105
+        $body = Content::instance('MarkupCode', $body)->activate();
106 106
 		
107
-		return $body;
108
-	}
109
-
110
-	final protected function get_right_side()
111
-	{
112
-		$side_array = array();
113
-		$side_array['tags'] = $this->get_tag_cloud();
114
-		$side_array['comments'] = $this->get_comments();
115
-		return $side_array;
116
-	}
117
-
118
-	final private function get_tag_cloud()
119
-	{
107
+        return $body;
108
+    }
109
+
110
+    final protected function get_right_side()
111
+    {
112
+        $side_array = array();
113
+        $side_array['tags'] = $this->get_tag_cloud();
114
+        $side_array['comments'] = $this->get_comments();
115
+        return $side_array;
116
+    }
117
+
118
+    final private function get_tag_cloud()
119
+    {
120 120
         global $container;
121 121
         $repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']);
122 122
         $tag_result = $repository->getTagCloud();
123 123
 		
124
-		$maximum_tag_count = $this->get_maximum_tag_count($tag_result);
124
+        $maximum_tag_count = $this->get_maximum_tag_count($tag_result);
125 125
 		
126
-		$cloud_array = array();
127
-		foreach($tag_result as $tag)
128
-		{
129
-			if($tag['count'] < self::$MINIMUM_TAG_COUNT)
130
-				continue;
126
+        $cloud_array = array();
127
+        foreach($tag_result as $tag)
128
+        {
129
+            if($tag['count'] < self::$MINIMUM_TAG_COUNT)
130
+                continue;
131 131
 			
132
-			$tag_object = new stdclass();
133
-			$tag_object->name = $tag['tag'];
134
-			$tag_object->link = Content::instance('URLSafe', "/tag/{$tag['tag']}/")->activate();
135
-			$tag_object->scalar = floor(($tag['count'] - 1) * (9 / ($maximum_tag_count - self::$MINIMUM_TAG_COUNT)));
136
-			$cloud_array[] = $tag_object;
137
-		}
132
+            $tag_object = new stdclass();
133
+            $tag_object->name = $tag['tag'];
134
+            $tag_object->link = Content::instance('URLSafe', "/tag/{$tag['tag']}/")->activate();
135
+            $tag_object->scalar = floor(($tag['count'] - 1) * (9 / ($maximum_tag_count - self::$MINIMUM_TAG_COUNT)));
136
+            $cloud_array[] = $tag_object;
137
+        }
138 138
 		
139
-		return $cloud_array;
140
-	}
139
+        return $cloud_array;
140
+    }
141 141
 
142
-	final private function get_maximum_tag_count($tag_result)
143
-	{
144
-		$maximum = 1;
142
+    final private function get_maximum_tag_count($tag_result)
143
+    {
144
+        $maximum = 1;
145 145
 		
146
-		foreach($tag_result as $tag)
147
-		{
148
-			if($tag['count'] > $maximum)
149
-				$maximum = $tag['count'];
150
-		}
151
-		return $maximum;
152
-	}
146
+        foreach($tag_result as $tag)
147
+        {
148
+            if($tag['count'] > $maximum)
149
+                $maximum = $tag['count'];
150
+        }
151
+        return $maximum;
152
+    }
153 153
 
154 154
     final private function get_comments()
155 155
     {
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 		Loader::load('collector', 'image/PhotoCollector');
40 40
 		$photo_result = PhotoCollector::getRow($id);
41 41
 		
42
-		if($photo_result == null)
42
+		if ($photo_result == null)
43 43
 			return;
44 44
 		
45 45
 		$name = $photo_result->name;
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         $tag_result = $repository->getTagsForPost($post['id']);
85 85
 
86 86
         $tag_array = array();
87
-		foreach($tag_result as $tag)
87
+		foreach ($tag_result as $tag)
88 88
 		{
89 89
 			$tag_object = new stdclass();
90 90
 			$tag_object->name = $tag['tag'];
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	{
99 99
 		$body = $post['body'];
100 100
 		
101
-		if($trim)
101
+		if ($trim)
102 102
 			$body = Content::instance('SmartTrim', $body)->activate(self::$LENGTH_OF_TRIMMED_POST);
103 103
 		
104 104
 		$body = Content::instance('FixPhoto', $body)->activate(false, 'standard');
@@ -124,9 +124,9 @@  discard block
 block discarded – undo
124 124
 		$maximum_tag_count = $this->get_maximum_tag_count($tag_result);
125 125
 		
126 126
 		$cloud_array = array();
127
-		foreach($tag_result as $tag)
127
+		foreach ($tag_result as $tag)
128 128
 		{
129
-			if($tag['count'] < self::$MINIMUM_TAG_COUNT)
129
+			if ($tag['count'] < self::$MINIMUM_TAG_COUNT)
130 130
 				continue;
131 131
 			
132 132
 			$tag_object = new stdclass();
@@ -143,9 +143,9 @@  discard block
 block discarded – undo
143 143
 	{
144 144
 		$maximum = 1;
145 145
 		
146
-		foreach($tag_result as $tag)
146
+		foreach ($tag_result as $tag)
147 147
 		{
148
-			if($tag['count'] > $maximum)
148
+			if ($tag['count'] > $maximum)
149 149
 				$maximum = $tag['count'];
150 150
 		}
151 151
 		return $maximum;
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
         $container['logger']->info("CommentService | Sidebar | {$elapsed}");
175 175
 
176 176
         $array = array();
177
-        foreach($comment_response as $comment)
177
+        foreach ($comment_response as $comment)
178 178
         {
179 179
             $body = Content::instance('CleanComment', $comment['body'])->activate();
180 180
             $body = strip_tags($body);
Please login to merge, or discard this patch.
Braces   +36 added lines, -32 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 Loader::load('controller', '/PageController');
4 4
 Loader::load('utility', 'Content');
5 5
 
6
-abstract class DefaultPageController extends PageController
7
-{
6
+abstract class DefaultPageController extends PageController
7
+{
8 8
 
9 9
 	private static $RECENT_COMMENT_COUNT = 10;
10 10
 	private static $MINIMUM_TAG_COUNT = 10;
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
 
15 15
 	private static $INTRODUCTION_IMAGE_PATTERN = '<img src="/photo/%s/%s-size-%s.jpg" height="%d" width="%d" alt="%s" />';
16 16
 
17
-	protected function set_head_data()
18
-	{
17
+	protected function set_head_data()
18
+	{
19 19
     $this->set_head('rss_link', [
20 20
       'title' => 'Jacob Emerick Blog Feed',
21 21
       'url' => '/rss.xml'
@@ -29,18 +29,19 @@  discard block
 block discarded – undo
29 29
 		$this->add_css('blog');
30 30
 	}
31 31
 
32
-	protected function get_introduction()
33
-	{
32
+	protected function get_introduction()
33
+	{
34 34
 		return;
35 35
 	}
36 36
 
37
-	protected function get_introduction_image($id)
38
-	{
37
+	protected function get_introduction_image($id)
38
+	{
39 39
 		Loader::load('collector', 'image/PhotoCollector');
40 40
 		$photo_result = PhotoCollector::getRow($id);
41 41
 		
42
-		if($photo_result == null)
43
-			return;
42
+		if($photo_result == null) {
43
+					return;
44
+		}
44 45
 		
45 46
 		$name = $photo_result->name;
46 47
 		$category = $photo_result->category;
@@ -52,8 +53,8 @@  discard block
 block discarded – undo
52 53
 		return sprintf(self::$INTRODUCTION_IMAGE_PATTERN, $category, $name, $size, $height, $width, $description);
53 54
 	}
54 55
 
55
-	protected function set_body_data()
56
-	{
56
+	protected function set_body_data()
57
+	{
57 58
 		$this->set_body('introduction', $this->get_introduction());
58 59
 		$this->set_body('right_side', $this->get_right_side());
59 60
 		$this->set_body('activity_array', $this->get_recent_activity());
@@ -61,8 +62,8 @@  discard block
 block discarded – undo
61 62
 		$this->set_body_view('Page');
62 63
 	}
63 64
 
64
-	final protected function format_post($post, $trim = false)
65
-	{
65
+	final protected function format_post($post, $trim = false)
66
+	{
66 67
 		$post_object = new stdclass();
67 68
 		
68 69
 		$post_object->title = $post['title'];
@@ -77,8 +78,8 @@  discard block
 block discarded – undo
77 78
 		return $post_object;
78 79
 	}
79 80
 
80
-	final private function get_tags_for_post($post)
81
-	{
81
+	final private function get_tags_for_post($post)
82
+	{
82 83
         global $container;
83 84
         $repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']);
84 85
         $tag_result = $repository->getTagsForPost($post['id']);
@@ -94,12 +95,13 @@  discard block
 block discarded – undo
94 95
 		return $tag_array;
95 96
 	}
96 97
 
97
-	final private function get_body_for_post($post, $trim)
98
-	{
98
+	final private function get_body_for_post($post, $trim)
99
+	{
99 100
 		$body = $post['body'];
100 101
 		
101
-		if($trim)
102
-			$body = Content::instance('SmartTrim', $body)->activate(self::$LENGTH_OF_TRIMMED_POST);
102
+		if($trim) {
103
+					$body = Content::instance('SmartTrim', $body)->activate(self::$LENGTH_OF_TRIMMED_POST);
104
+		}
103 105
 		
104 106
 		$body = Content::instance('FixPhoto', $body)->activate(false, 'standard');
105 107
 		$body = Content::instance('MarkupCode', $body)->activate();
@@ -107,16 +109,16 @@  discard block
 block discarded – undo
107 109
 		return $body;
108 110
 	}
109 111
 
110
-	final protected function get_right_side()
111
-	{
112
+	final protected function get_right_side()
113
+	{
112 114
 		$side_array = array();
113 115
 		$side_array['tags'] = $this->get_tag_cloud();
114 116
 		$side_array['comments'] = $this->get_comments();
115 117
 		return $side_array;
116 118
 	}
117 119
 
118
-	final private function get_tag_cloud()
119
-	{
120
+	final private function get_tag_cloud()
121
+	{
120 122
         global $container;
121 123
         $repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']);
122 124
         $tag_result = $repository->getTagCloud();
@@ -126,8 +128,9 @@  discard block
 block discarded – undo
126 128
 		$cloud_array = array();
127 129
 		foreach($tag_result as $tag)
128 130
 		{
129
-			if($tag['count'] < self::$MINIMUM_TAG_COUNT)
130
-				continue;
131
+			if($tag['count'] < self::$MINIMUM_TAG_COUNT) {
132
+							continue;
133
+			}
131 134
 			
132 135
 			$tag_object = new stdclass();
133 136
 			$tag_object->name = $tag['tag'];
@@ -139,20 +142,21 @@  discard block
 block discarded – undo
139 142
 		return $cloud_array;
140 143
 	}
141 144
 
142
-	final private function get_maximum_tag_count($tag_result)
143
-	{
145
+	final private function get_maximum_tag_count($tag_result)
146
+	{
144 147
 		$maximum = 1;
145 148
 		
146 149
 		foreach($tag_result as $tag)
147 150
 		{
148
-			if($tag['count'] > $maximum)
149
-				$maximum = $tag['count'];
151
+			if($tag['count'] > $maximum) {
152
+							$maximum = $tag['count'];
153
+			}
150 154
 		}
151 155
 		return $maximum;
152 156
 	}
153 157
 
154
-    final private function get_comments()
155
-    {
158
+    final private function get_comments()
159
+    {
156 160
         global $container;
157 161
         $repository = new Jacobemerick\Web\Domain\Comment\Comment\ServiceCommentRepository($container['comment_service_api']);
158 162
         $start = microtime(true);
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -94,6 +94,9 @@
 block discarded – undo
94 94
 		return $tag_array;
95 95
 	}
96 96
 
97
+	/**
98
+	 * @param boolean $trim
99
+	 */
97 100
 	final private function get_body_for_post($post, $trim)
98 101
 	{
99 102
 		$body = $post['body'];
Please login to merge, or discard this patch.