Completed
Push — master ( 5bed8f...b71929 )
by Jacob
04:00
created
utility/content/FixPhotoContent.class.inc.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 	protected function execute($is_absolute = false, $size = 'medium')
13 13
 	{
14 14
 		preg_match_all(self::$PHOTO_PLACEHOLDER_MATCH, $this->content, $matches);
15
-		foreach($matches[1] as $key => $match)
15
+		foreach ($matches[1] as $key => $match)
16 16
 		{
17 17
 			$photo_content = $this->get_photo_content($match, $size, $is_absolute);
18 18
 			$this->content = str_replace($matches[0][$key], $photo_content, $this->content);
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 		
38 38
 		Loader::load('collector', 'image/PhotoCollector');
39 39
 		$photo_result = PhotoCollector::fetchRow($category, $photo);
40
-		if($photo_result == false)
40
+		if ($photo_result == false)
41 41
 			return '';
42 42
 		
43 43
 		$height = $file_size[1];
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         }
50 50
 		
51 51
 		$domain = '/';
52
-		if($is_absolute)
52
+		if ($is_absolute)
53 53
 			$domain = Loader::getRootUrl('blog');
54 54
 		
55 55
 		return sprintf(self::$PHOTO_CONTENT, $domain, $category, $photo, $size, $height, $width, $description, $description);
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,8 +37,9 @@  discard block
 block discarded – undo
37 37
 		
38 38
 		Loader::load('collector', 'image/PhotoCollector');
39 39
 		$photo_result = PhotoCollector::fetchRow($category, $photo);
40
-		if($photo_result == false)
41
-			return '';
40
+		if($photo_result == false) {
41
+					return '';
42
+		}
42 43
 		
43 44
 		$height = $file_size[1];
44 45
 		$width = $file_size[0];
@@ -49,8 +50,9 @@  discard block
 block discarded – undo
49 50
         }
50 51
 		
51 52
 		$domain = '/';
52
-		if($is_absolute)
53
-			$domain = Loader::getRootUrl('blog');
53
+		if($is_absolute) {
54
+					$domain = Loader::getRootUrl('blog');
55
+		}
54 56
 		
55 57
 		return sprintf(self::$PHOTO_CONTENT, $domain, $category, $photo, $size, $height, $width, $description, $description);
56 58
 	}
Please login to merge, or discard this patch.
utility/content/ElapsedTimeContent.class.inc.php 2 patches
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -10,61 +10,61 @@
 block discarded – undo
10 10
 		$previous_time = strtotime($this->content);
11 11
 		$current_time = time();
12 12
 		
13
-		if($current_time <= $previous_time)
13
+		if ($current_time <= $previous_time)
14 14
 			$this->content = 'few seconds ago';
15
-		else if(($current_time - $previous_time) < 30)
15
+		else if (($current_time - $previous_time) < 30)
16 16
 			$this->content = 'few seconds ago';
17
-		else if(($current_time - $previous_time) < 1.5 * 60)
17
+		else if (($current_time - $previous_time) < 1.5 * 60)
18 18
 			$this->content = 'a minute ago';
19
-		else if(($current_time - $previous_time) < 4 * 60)
19
+		else if (($current_time - $previous_time) < 4 * 60)
20 20
 			$this->content = 'few minutes ago';
21
-		else if(($current_time - $previous_time) < 7 * 60)
21
+		else if (($current_time - $previous_time) < 7 * 60)
22 22
 			$this->content = 'five minutes ago';
23
-		else if(($current_time - $previous_time) < 12 * 60)
23
+		else if (($current_time - $previous_time) < 12 * 60)
24 24
 			$this->content = 'ten minutes ago';
25
-		else if(($current_time - $previous_time) < 17 * 60)
25
+		else if (($current_time - $previous_time) < 17 * 60)
26 26
 			$this->content = 'fifteen minutes ago';
27
-		else if(($current_time - $previous_time) < 22 * 60)
27
+		else if (($current_time - $previous_time) < 22 * 60)
28 28
 			$this->content = 'twenty minutes ago';
29
-		else if(($current_time - $previous_time) < 37 * 60)
29
+		else if (($current_time - $previous_time) < 37 * 60)
30 30
 			$this->content = 'half hour ago';
31
-		else if(($current_time - $previous_time) < 52 * 60)
31
+		else if (($current_time - $previous_time) < 52 * 60)
32 32
 			$this->content = 'forty-five minutes ago';
33
-		else if(($current_time - $previous_time) < 1.5 * 60 * 60)
33
+		else if (($current_time - $previous_time) < 1.5 * 60 * 60)
34 34
 			$this->content = 'an hour ago';
35
-		else if(($current_time - $previous_time) < 2.5 * 60 * 60)
35
+		else if (($current_time - $previous_time) < 2.5 * 60 * 60)
36 36
 			$this->content = 'two hours ago';
37
-		else if(($current_time - $previous_time) < 3.5 * 60 * 60)
37
+		else if (($current_time - $previous_time) < 3.5 * 60 * 60)
38 38
 			$this->content = 'three hours ago';
39
-		else if(($current_time - $previous_time) < 4.5 * 60 * 60)
39
+		else if (($current_time - $previous_time) < 4.5 * 60 * 60)
40 40
 			$this->content = 'few hours ago';
41
-		else if(($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'pm')
41
+		else if (($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'pm')
42 42
 			$this->content = 'this afternoon';
43
-		else if(($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'am')
43
+		else if (($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'am')
44 44
 			$this->content = 'this morning';
45
-		else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm' && date('G', $previous_time) >= 17)
45
+		else if (($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm' && date('G', $previous_time) >= 17)
46 46
 			$this->content = 'yesterday evening';
47
-		else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm')
47
+		else if (($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm')
48 48
 			$this->content = 'yesterday afternoon';
49
-		else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'am')
49
+		else if (($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'am')
50 50
 			$this->content = 'yesterday morning';
51
-		else if(($current_time - $previous_time) < 3 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 2)
51
+		else if (($current_time - $previous_time) < 3 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 2)
52 52
 			$this->content = 'two days ago';
53
-		else if(($current_time - $previous_time) < 4 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 3)
53
+		else if (($current_time - $previous_time) < 4 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 3)
54 54
 			$this->content = 'three days ago';
55
-		else if(($current_time - $previous_time) < 1 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time))
55
+		else if (($current_time - $previous_time) < 1 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time))
56 56
 			$this->content = 'earlier this week';
57
-		else if(($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1 && date('w', $previous_time) >= 3)
57
+		else if (($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1 && date('w', $previous_time) >= 3)
58 58
 			$this->content = 'late last week';
59
-		else if(($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1)
59
+		else if (($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1)
60 60
 			$this->content = 'early last week';
61
-		else if(($current_time - $previous_time) < 3 * 7 * 24 * 60 * 60)
61
+		else if (($current_time - $previous_time) < 3 * 7 * 24 * 60 * 60)
62 62
 			$this->content = 'few weeks ago';
63
-		else if(($current_time - $previous_time) < 1.25* 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time))
63
+		else if (($current_time - $previous_time) < 1.25 * 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time))
64 64
 			$this->content = 'earlier this month';
65
-		else if(($current_time - $previous_time) < 2 * 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time) + 1)
65
+		else if (($current_time - $previous_time) < 2 * 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time) + 1)
66 66
 			$this->content = 'last month';
67
-		else if(($current_time - $previous_time) < 4 * 4 * 7 * 24 * 60 * 60)
67
+		else if (($current_time - $previous_time) < 4 * 4 * 7 * 24 * 60 * 60)
68 68
 			$this->content = 'several months ago';
69 69
 		else
70 70
 			$this->content = 'long ago';
Please login to merge, or discard this patch.
Braces   +59 added lines, -58 removed lines patch added patch discarded remove patch
@@ -10,64 +10,65 @@
 block discarded – undo
10 10
 		$previous_time = strtotime($this->content);
11 11
 		$current_time = time();
12 12
 		
13
-		if($current_time <= $previous_time)
14
-			$this->content = 'few seconds ago';
15
-		else if(($current_time - $previous_time) < 30)
16
-			$this->content = 'few seconds ago';
17
-		else if(($current_time - $previous_time) < 1.5 * 60)
18
-			$this->content = 'a minute ago';
19
-		else if(($current_time - $previous_time) < 4 * 60)
20
-			$this->content = 'few minutes ago';
21
-		else if(($current_time - $previous_time) < 7 * 60)
22
-			$this->content = 'five minutes ago';
23
-		else if(($current_time - $previous_time) < 12 * 60)
24
-			$this->content = 'ten minutes ago';
25
-		else if(($current_time - $previous_time) < 17 * 60)
26
-			$this->content = 'fifteen minutes ago';
27
-		else if(($current_time - $previous_time) < 22 * 60)
28
-			$this->content = 'twenty minutes ago';
29
-		else if(($current_time - $previous_time) < 37 * 60)
30
-			$this->content = 'half hour ago';
31
-		else if(($current_time - $previous_time) < 52 * 60)
32
-			$this->content = 'forty-five minutes ago';
33
-		else if(($current_time - $previous_time) < 1.5 * 60 * 60)
34
-			$this->content = 'an hour ago';
35
-		else if(($current_time - $previous_time) < 2.5 * 60 * 60)
36
-			$this->content = 'two hours ago';
37
-		else if(($current_time - $previous_time) < 3.5 * 60 * 60)
38
-			$this->content = 'three hours ago';
39
-		else if(($current_time - $previous_time) < 4.5 * 60 * 60)
40
-			$this->content = 'few hours ago';
41
-		else if(($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'pm')
42
-			$this->content = 'this afternoon';
43
-		else if(($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'am')
44
-			$this->content = 'this morning';
45
-		else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm' && date('G', $previous_time) >= 17)
46
-			$this->content = 'yesterday evening';
47
-		else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm')
48
-			$this->content = 'yesterday afternoon';
49
-		else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'am')
50
-			$this->content = 'yesterday morning';
51
-		else if(($current_time - $previous_time) < 3 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 2)
52
-			$this->content = 'two days ago';
53
-		else if(($current_time - $previous_time) < 4 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 3)
54
-			$this->content = 'three days ago';
55
-		else if(($current_time - $previous_time) < 1 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time))
56
-			$this->content = 'earlier this week';
57
-		else if(($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1 && date('w', $previous_time) >= 3)
58
-			$this->content = 'late last week';
59
-		else if(($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1)
60
-			$this->content = 'early last week';
61
-		else if(($current_time - $previous_time) < 3 * 7 * 24 * 60 * 60)
62
-			$this->content = 'few weeks ago';
63
-		else if(($current_time - $previous_time) < 1.25* 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time))
64
-			$this->content = 'earlier this month';
65
-		else if(($current_time - $previous_time) < 2 * 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time) + 1)
66
-			$this->content = 'last month';
67
-		else if(($current_time - $previous_time) < 4 * 4 * 7 * 24 * 60 * 60)
68
-			$this->content = 'several months ago';
69
-		else
70
-			$this->content = 'long ago';
13
+		if($current_time <= $previous_time) {
14
+					$this->content = 'few seconds ago';
15
+		} else if(($current_time - $previous_time) < 30) {
16
+					$this->content = 'few seconds ago';
17
+		} else if(($current_time - $previous_time) < 1.5 * 60) {
18
+					$this->content = 'a minute ago';
19
+		} else if(($current_time - $previous_time) < 4 * 60) {
20
+					$this->content = 'few minutes ago';
21
+		} else if(($current_time - $previous_time) < 7 * 60) {
22
+					$this->content = 'five minutes ago';
23
+		} else if(($current_time - $previous_time) < 12 * 60) {
24
+					$this->content = 'ten minutes ago';
25
+		} else if(($current_time - $previous_time) < 17 * 60) {
26
+					$this->content = 'fifteen minutes ago';
27
+		} else if(($current_time - $previous_time) < 22 * 60) {
28
+					$this->content = 'twenty minutes ago';
29
+		} else if(($current_time - $previous_time) < 37 * 60) {
30
+					$this->content = 'half hour ago';
31
+		} else if(($current_time - $previous_time) < 52 * 60) {
32
+					$this->content = 'forty-five minutes ago';
33
+		} else if(($current_time - $previous_time) < 1.5 * 60 * 60) {
34
+					$this->content = 'an hour ago';
35
+		} else if(($current_time - $previous_time) < 2.5 * 60 * 60) {
36
+					$this->content = 'two hours ago';
37
+		} else if(($current_time - $previous_time) < 3.5 * 60 * 60) {
38
+					$this->content = 'three hours ago';
39
+		} else if(($current_time - $previous_time) < 4.5 * 60 * 60) {
40
+					$this->content = 'few hours ago';
41
+		} else if(($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'pm') {
42
+					$this->content = 'this afternoon';
43
+		} else if(($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'am') {
44
+					$this->content = 'this morning';
45
+		} else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm' && date('G', $previous_time) >= 17) {
46
+					$this->content = 'yesterday evening';
47
+		} else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm') {
48
+					$this->content = 'yesterday afternoon';
49
+		} else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'am') {
50
+					$this->content = 'yesterday morning';
51
+		} else if(($current_time - $previous_time) < 3 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 2) {
52
+					$this->content = 'two days ago';
53
+		} else if(($current_time - $previous_time) < 4 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 3) {
54
+					$this->content = 'three days ago';
55
+		} else if(($current_time - $previous_time) < 1 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time)) {
56
+					$this->content = 'earlier this week';
57
+		} else if(($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1 && date('w', $previous_time) >= 3) {
58
+					$this->content = 'late last week';
59
+		} else if(($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1) {
60
+					$this->content = 'early last week';
61
+		} else if(($current_time - $previous_time) < 3 * 7 * 24 * 60 * 60) {
62
+					$this->content = 'few weeks ago';
63
+		} else if(($current_time - $previous_time) < 1.25* 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time)) {
64
+					$this->content = 'earlier this month';
65
+		} else if(($current_time - $previous_time) < 2 * 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time) + 1) {
66
+					$this->content = 'last month';
67
+		} else if(($current_time - $previous_time) < 4 * 4 * 7 * 24 * 60 * 60) {
68
+					$this->content = 'several months ago';
69
+		} else {
70
+					$this->content = 'long ago';
71
+		}
71 72
 	}
72 73
 
73 74
 }
74 75
\ No newline at end of file
Please login to merge, or discard this patch.
utility/content/FetchFirstPhotoContent.class.inc.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 	protected function execute($is_absolute = false, $size = 'thumb')
13 13
 	{
14
-		if(preg_match(self::$PHOTO_PLACEHOLDER_MATCH, $this->content, $match) === 1)
14
+		if (preg_match(self::$PHOTO_PLACEHOLDER_MATCH, $this->content, $match) === 1)
15 15
 			$this->content = $this->get_thumb($match[1], $is_absolute, $size);
16 16
 		else
17 17
 			$this->content = self::$DEFAULT_RETURN;
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 		
35 35
 		Loader::load('collector', 'image/PhotoCollector');
36 36
 		$photo_result = PhotoCollector::fetchRow($category, $photo);
37
-		if($photo_result == false)
37
+		if ($photo_result == false)
38 38
 			return '';
39 39
 		
40 40
 		$height = $file_size[1];
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 		$description = $photo_result->description;
43 43
 		
44 44
 		$domain = '/';
45
-		if($is_absolute)
45
+		if ($is_absolute)
46 46
 			$domain = Loader::getRootUrl();
47 47
 		
48 48
 		return sprintf(self::$IMAGE_NODE, $domain, $category, $photo, $size, $extension, $height, $width, $description);
Please login to merge, or discard this patch.
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -11,10 +11,11 @@  discard block
 block discarded – undo
11 11
 
12 12
 	protected function execute($is_absolute = false, $size = 'thumb')
13 13
 	{
14
-		if(preg_match(self::$PHOTO_PLACEHOLDER_MATCH, $this->content, $match) === 1)
15
-			$this->content = $this->get_thumb($match[1], $is_absolute, $size);
16
-		else
17
-			$this->content = self::$DEFAULT_RETURN;
14
+		if(preg_match(self::$PHOTO_PLACEHOLDER_MATCH, $this->content, $match) === 1) {
15
+					$this->content = $this->get_thumb($match[1], $is_absolute, $size);
16
+		} else {
17
+					$this->content = self::$DEFAULT_RETURN;
18
+		}
18 19
 		return;
19 20
 	}
20 21
 
@@ -34,16 +35,18 @@  discard block
 block discarded – undo
34 35
 		
35 36
 		Loader::load('collector', 'image/PhotoCollector');
36 37
 		$photo_result = PhotoCollector::fetchRow($category, $photo);
37
-		if($photo_result == false)
38
-			return '';
38
+		if($photo_result == false) {
39
+					return '';
40
+		}
39 41
 		
40 42
 		$height = $file_size[1];
41 43
 		$width = $file_size[0];
42 44
 		$description = $photo_result->description;
43 45
 		
44 46
 		$domain = '/';
45
-		if($is_absolute)
46
-			$domain = Loader::getRootURL(URLDecode::getSite());
47
+		if($is_absolute) {
48
+					$domain = Loader::getRootURL(URLDecode::getSite());
49
+		}
47 50
 
48 51
 		return sprintf(self::$IMAGE_NODE, $domain, $category, $photo, $size, $extension, $height, $width, $description);
49 52
 	}
Please login to merge, or discard this patch.
controller/lifestream/DefaultListController.class.inc.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,11 +56,11 @@
 block discarded – undo
56 56
 	final private function get_list_posts()
57 57
 	{
58 58
 		$post_array = array();
59
-		foreach($this->get_list_results() as $post)
59
+		foreach ($this->get_list_results() as $post)
60 60
 		{
61 61
 			$post_array[] = $this->format_post($post, true);
62 62
 		}
63
-		if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search')
63
+		if (count($post_array) < 1 && URLDecode::getPiece(1) !== 'search')
64 64
 			$this->eject();
65 65
 		return $post_array;
66 66
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,8 +60,9 @@
 block discarded – undo
60 60
 		{
61 61
 			$post_array[] = $this->format_post($post, true);
62 62
 		}
63
-		if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search')
64
-			$this->eject();
63
+		if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') {
64
+					$this->eject();
65
+		}
65 66
 		return $post_array;
66 67
 	}
67 68
 
Please login to merge, or discard this patch.
controller/home/ContactController.class.inc.php 3 patches
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -33,17 +33,21 @@
 block discarded – undo
33 33
 
34 34
 	private function process_form()
35 35
 	{
36
-		if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!')
37
-			return (object) array('display' => 'normal');
36
+		if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!') {
37
+					return (object) array('display' => 'normal');
38
+		}
38 39
 		
39 40
 		Loader::load('utility', 'Validate');
40 41
 		$error_result = array();
41
-		if(!Validate::checkRequest('post', 'name', 'string'))
42
-			$error_result['name'] = 'please enter your name';
43
-		if(!Validate::checkRequest('post', 'email', 'string'))
44
-			$error_result['email'] = 'please enter a valid email';
45
-		if(!Validate::checkRequest('post', 'message', 'string'))
46
-			$error_result['message'] = 'please write a message';
42
+		if(!Validate::checkRequest('post', 'name', 'string')) {
43
+					$error_result['name'] = 'please enter your name';
44
+		}
45
+		if(!Validate::checkRequest('post', 'email', 'string')) {
46
+					$error_result['email'] = 'please enter a valid email';
47
+		}
48
+		if(!Validate::checkRequest('post', 'message', 'string')) {
49
+					$error_result['message'] = 'please write a message';
50
+		}
47 51
 		
48 52
 		$values = (object) array(
49 53
 			'name' => Request::getPost('name'),
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -60,16 +60,16 @@
 block discarded – undo
60 60
 				'values' => $values);
61 61
 		}
62 62
 
63
-    global $container;
64
-    $sent = $container['mail']
65
-      ->addTo($container['config']->admin_email)
66
-      ->setSubject('Home Page Contact')
67
-      ->setPlainMessage(
68
-        "Name: {$values->name}\n" .
69
-        "Email: {$values->email}\n" .
70
-        "Message: {$values->message}"
71
-      )
72
-      ->send();		
63
+	global $container;
64
+	$sent = $container['mail']
65
+	  ->addTo($container['config']->admin_email)
66
+	  ->setSubject('Home Page Contact')
67
+	  ->setPlainMessage(
68
+		"Name: {$values->name}\n" .
69
+		"Email: {$values->email}\n" .
70
+		"Message: {$values->message}"
71
+	  )
72
+	  ->send();		
73 73
 
74 74
 		return (object) array('display' => 'success');
75 75
 	}
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,16 +35,16 @@  discard block
 block discarded – undo
35 35
 
36 36
 	private function process_form()
37 37
 	{
38
-		if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!')
38
+		if (!Request::hasPost() || Request::getPost('submit') != 'Send Message!')
39 39
 			return (object) array('display' => 'normal');
40 40
 		
41 41
 		Loader::load('utility', 'Validate');
42 42
 		$error_result = array();
43
-		if(!Validate::checkRequest('post', 'name', 'string'))
43
+		if (!Validate::checkRequest('post', 'name', 'string'))
44 44
 			$error_result['name'] = 'please enter your name';
45
-		if(!Validate::checkRequest('post', 'email', 'string'))
45
+		if (!Validate::checkRequest('post', 'email', 'string'))
46 46
 			$error_result['email'] = 'please enter a valid email';
47
-		if(!Validate::checkRequest('post', 'message', 'string'))
47
+		if (!Validate::checkRequest('post', 'message', 'string'))
48 48
 			$error_result['message'] = 'please write a message';
49 49
 		
50 50
 		$values = (object) array(
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 			'email' => Request::getPost('email'),
53 53
 			'message' => Request::getPost('message'));
54 54
 		
55
-		if(count($error_result) > 0)
55
+		if (count($error_result) > 0)
56 56
 		{
57 57
 			return (object) array(
58 58
 				'display' => 'error',
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
       ->addTo($container['config']->admin_email)
66 66
       ->setSubject('Home Page Contact')
67 67
       ->setPlainMessage(
68
-        "Name: {$values->name}\n" .
69
-        "Email: {$values->email}\n" .
68
+        "Name: {$values->name}\n".
69
+        "Email: {$values->email}\n".
70 70
         "Message: {$values->message}"
71 71
       )
72 72
       ->send();		
Please login to merge, or discard this patch.
controller/lifestream/PostController.class.inc.php 3 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,14 +20,14 @@  discard block
 block discarded – undo
20 20
 		parent::__construct();
21 21
 		
22 22
 		$id = URLDecode::getPiece(2);
23
-		if(!$id || !is_numeric($id))
23
+		if (!$id || !is_numeric($id))
24 24
 			$this->eject();
25 25
 		
26 26
 		$post = $this->postRepository->getPostById($id);
27
-		if(!$post)
27
+		if (!$post)
28 28
 			$this->eject();
29 29
 		
30
-		if(URLDecode::getPiece(1) != $post['type'])
30
+		if (URLDecode::getPiece(1) != $post['type'])
31 31
 			$this->eject();
32 32
 		
33 33
 		$this->post = $post;
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
 	private function get_title()
61 61
 	{
62
-		switch($this->post['type'])
62
+		switch ($this->post['type'])
63 63
 		{
64 64
 			case 'blog' :
65 65
 				return 'Jacob blogged';
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
 	private function get_description()
86 86
 	{
87
-		switch($this->post['type'])
87
+		switch ($this->post['type'])
88 88
 		{
89 89
 			case 'blog' :
90 90
 				return 'Another awesome blog post from Jacob. Did I mention it was awesome?';
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,15 +20,18 @@
 block discarded – undo
20 20
 		parent::__construct();
21 21
 		
22 22
 		$id = URLDecode::getPiece(2);
23
-		if(!$id || !is_numeric($id))
24
-			$this->eject();
23
+		if(!$id || !is_numeric($id)) {
24
+					$this->eject();
25
+		}
25 26
 		
26 27
 		$post = $this->postRepository->getPostById($id);
27
-		if(!$post)
28
-			$this->eject();
28
+		if(!$post) {
29
+					$this->eject();
30
+		}
29 31
 		
30
-		if(URLDecode::getPiece(1) != $post['type'])
31
-			$this->eject();
32
+		if(URLDecode::getPiece(1) != $post['type']) {
33
+					$this->eject();
34
+		}
32 35
 		
33 36
 		$this->post = $post;
34 37
 	}
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
 			case 'distance' :
71 71
 				return 'Jacob ran xor hiked';
72 72
 			break;
73
-      case 'github' :
74
-        return 'Jacob did code';
75
-      break;
73
+	  case 'github' :
74
+		return 'Jacob did code';
75
+	  break;
76 76
 			case 'hulu' :
77 77
 				return 'What Jacob watched';
78 78
 			break;
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
 			case 'distance' :
99 99
 				return 'Well, it might have been both at the same time if there was a bear.';
100 100
 			break;
101
-      case 'github' :
102
-        return 'An epic code change by Jacob on the Githubs.';
103
-      break;
101
+	  case 'github' :
102
+		return 'An epic code change by Jacob on the Githubs.';
103
+	  break;
104 104
 			case 'hulu' :
105 105
 				return 'It was a cold, dark night, so Jacob watched something on Hulu.';
106 106
 			break;
Please login to merge, or discard this patch.
utility/Header.class.inc.php 4 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -131,6 +131,9 @@
 block discarded – undo
131 131
 		self::send($array);
132 132
 	}
133 133
 
134
+	/**
135
+	 * @param string[] $array
136
+	 */
134 137
 	private static function send($array, $gzip = true)
135 138
 	{
136 139
 		if($gzip)
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@
 block discarded – undo
152 152
 	private static function start_gzipping()
153 153
 	{
154 154
 		if(!ob_start('ob_gzhandler'))
155
-            ob_start();
155
+			ob_start();
156 156
 	}
157 157
 
158 158
 }
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -133,8 +133,9 @@  discard block
 block discarded – undo
133 133
 
134 134
 	private static function send($array, $gzip = true)
135 135
 	{
136
-		if($gzip)
137
-			self::start_gzipping();
136
+		if($gzip) {
137
+					self::start_gzipping();
138
+		}
138 139
 		
139 140
 		foreach($array as $row)
140 141
 		{
@@ -144,15 +145,17 @@  discard block
 block discarded – undo
144 145
 
145 146
 	private static function get_date($timestamp = false)
146 147
 	{
147
-		if($timestamp == 0)
148
-			$timestamp = time();
148
+		if($timestamp == 0) {
149
+					$timestamp = time();
150
+		}
149 151
 		return gmdate('D, d M Y H:i:s \G\M\T', $timestamp);
150 152
 	}
151 153
 
152 154
 	private static function start_gzipping()
153 155
 	{
154
-		if(!ob_start('ob_gzhandler'))
155
-            ob_start();
156
+		if(!ob_start('ob_gzhandler')) {
157
+		            ob_start();
158
+		}
156 159
 	}
157 160
 
158 161
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 			'Cache-Control: no-cache',
11 11
 			'Content-Language: en',
12 12
 			'Content-Type: application/json',
13
-			'Expires: ' . self::get_date(time() - 1),
14
-			'Last-Modified: ' . self::get_date(),
13
+			'Expires: '.self::get_date(time() - 1),
14
+			'Last-Modified: '.self::get_date(),
15 15
 			'X-Powered-By: jacobemerick.com');
16 16
 		self::send($array);
17 17
 	}
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
 			'Cache-Control: no-cache',
24 24
 			'Content-Language: en',
25 25
 			'Content-Type: text/html',
26
-			'Expires: ' . self::get_date(time() - 1),
27
-			'Last-Modified: ' . self::get_date(),
26
+			'Expires: '.self::get_date(time() - 1),
27
+			'Last-Modified: '.self::get_date(),
28 28
 			'X-Powered-By: jacobemerick.com');
29 29
 		self::send($array);
30 30
 	}
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 			'Cache-Control: no-cache',
43 43
 			'Content-Language: en',
44 44
 			'Content-Type: text/html',
45
-			'Expires: ' . self::get_date(time() - 1),
46
-			'Last-Modified: ' . self::get_date(),
45
+			'Expires: '.self::get_date(time() - 1),
46
+			'Last-Modified: '.self::get_date(),
47 47
 			'X-Powered-By: jacobemerick.com');
48 48
 		self::send($array);
49 49
 	}
@@ -55,18 +55,18 @@  discard block
 block discarded – undo
55 55
 			'Cache-Control: no-cache',
56 56
 			'Content-Language: en',
57 57
 			'Content-Type: text/html',
58
-			'Expires: ' . self::get_date(time() - 1),
59
-			'Last-Modified: ' . self::get_date(),
58
+			'Expires: '.self::get_date(time() - 1),
59
+			'Last-Modified: '.self::get_date(),
60 60
 			'X-Powered-By: jacobemerick.com');
61 61
 		self::send($array);
62 62
 	}
63 63
 
64 64
 	private static function send($array, $gzip = true)
65 65
 	{
66
-		if($gzip)
66
+		if ($gzip)
67 67
 			self::start_gzipping();
68 68
 		
69
-		foreach($array as $row)
69
+		foreach ($array as $row)
70 70
 		{
71 71
 			header($row, TRUE);
72 72
 		}
@@ -74,14 +74,14 @@  discard block
 block discarded – undo
74 74
 
75 75
 	private static function get_date($timestamp = false)
76 76
 	{
77
-		if($timestamp == 0)
77
+		if ($timestamp == 0)
78 78
 			$timestamp = time();
79 79
 		return gmdate('D, d M Y H:i:s \G\M\T', $timestamp);
80 80
 	}
81 81
 
82 82
 	private static function start_gzipping()
83 83
 	{
84
-		if(!ob_start('ob_gzhandler'))
84
+		if (!ob_start('ob_gzhandler'))
85 85
             ob_start();
86 86
 	}
87 87
 
Please login to merge, or discard this patch.
controller/waterfalls/DefaultPageController.class.inc.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 	protected static $WATERFALL_SITE_ID = 5;
12 12
 
13
-    protected $parent_navigation_item = '';
13
+	protected $parent_navigation_item = '';
14 14
 
15 15
 	protected function set_head_data()
16 16
 	{
@@ -19,45 +19,45 @@  discard block
 block discarded – undo
19 19
 		$this->add_css('waterfalls');
20 20
 	}
21 21
 
22
-    protected function add_waterfall_js()
23
-    {
24
-        $this->add_js('jquery');
25
-        $this->add_js('imagelightbox');
26
-        $this->add_js('waterfalls');
27
-    }
22
+	protected function add_waterfall_js()
23
+	{
24
+		$this->add_js('jquery');
25
+		$this->add_js('imagelightbox');
26
+		$this->add_js('waterfalls');
27
+	}
28 28
 
29 29
 	protected function set_body_data($page_type = 'normal')
30 30
 	{
31 31
 		$this->set_body('activity_array', $this->get_recent_activity());
32 32
 
33
-        $this->set_body('main_navigation', array(
34
-                (object) array(
35
-                    'uri' => '/falls/',
36
-                    'anchor' => 'Falls',
37
-                    'is_active' => $this->parent_navigation_item === 'falls',
38
-                ),
39
-                (object) array(
40
-                    'uri' => '/map/',
41
-                    'anchor' => 'Map',
42
-                    'is_active' => $this->parent_navigation_item === 'map',
43
-                ),
44
-                (object) array(
45
-                    'uri' => '/journal/',
46
-                    'anchor' => 'Journal',
47
-                    'is_active' => $this->parent_navigation_item === 'journal',
48
-                ),
49
-                (object) array(
50
-                    'uri' => '/about/',
51
-                    'anchor' => 'About',
52
-                    'is_active' => $this->parent_navigation_item === 'about',
53
-                )
54
-        ));
55
-
56
-        if ($page_type == 'wide') {
57
-            $this->set_body_view('WidePage');
58
-        } else {
59
-            $this->set_body_view('Page');
60
-        }
61
-    }
33
+		$this->set_body('main_navigation', array(
34
+				(object) array(
35
+					'uri' => '/falls/',
36
+					'anchor' => 'Falls',
37
+					'is_active' => $this->parent_navigation_item === 'falls',
38
+				),
39
+				(object) array(
40
+					'uri' => '/map/',
41
+					'anchor' => 'Map',
42
+					'is_active' => $this->parent_navigation_item === 'map',
43
+				),
44
+				(object) array(
45
+					'uri' => '/journal/',
46
+					'anchor' => 'Journal',
47
+					'is_active' => $this->parent_navigation_item === 'journal',
48
+				),
49
+				(object) array(
50
+					'uri' => '/about/',
51
+					'anchor' => 'About',
52
+					'is_active' => $this->parent_navigation_item === 'about',
53
+				)
54
+		));
55
+
56
+		if ($page_type == 'wide') {
57
+			$this->set_body_view('WidePage');
58
+		} else {
59
+			$this->set_body_view('Page');
60
+		}
61
+	}
62 62
 
63 63
 }
Please login to merge, or discard this patch.
src/Domain/Waterfall/Waterfall/MysqlWaterfallRepository.php 2 patches
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.
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -7,38 +7,38 @@
 block discarded – undo
7 7
 class MysqlWaterfallRepository implements WaterfallRepositoryInterface
8 8
 {
9 9
 
10
-    /** @var  Aura\Sql\ConnectionLocator */
11
-    protected $connections;
12
-
13
-    /**
14
-     * @param Aura\Sql\ConnectionLocator $connections
15
-     */
16
-    public function __construct(ConnectionLocator $connections)
17
-    {
18
-        $this->connections = $connections;
19
-    }
20
-
21
-    public function getWaterfalls($limit = null, $offset = 0)
22
-    {
23
-        $query = "
10
+	/** @var  Aura\Sql\ConnectionLocator */
11
+	protected $connections;
12
+
13
+	/**
14
+	 * @param Aura\Sql\ConnectionLocator $connections
15
+	 */
16
+	public function __construct(ConnectionLocator $connections)
17
+	{
18
+		$this->connections = $connections;
19
+	}
20
+
21
+	public function getWaterfalls($limit = null, $offset = 0)
22
+	{
23
+		$query = "
24 24
             SELECT `waterfall`.`id`, `waterfall`.`name`, `waterfall`.`alias`,
25 25
                    `watercourse`.`name` AS `watercourse`, `watercourse`.`alias` AS `watercourse_alias`
26 26
             FROM `jpemeric_waterfall`.`waterfall`
27 27
             INNER JOIN `jpemeric_waterfall`.`watercourse` ON `waterfall`.`watercourse` = `watercourse`.`id`
28 28
             WHERE `is_public` = :public
29 29
             ORDER BY `name`, `watercourse`";
30
-        if ($limit != null) {
31
-            $query .= "
30
+		if ($limit != null) {
31
+			$query .= "
32 32
             LIMIT {$offset}, {$limit}";
33
-        }
33
+		}
34 34
 
35
-        $bindings = [
36
-            'public' => 1,
37
-        ];
35
+		$bindings = [
36
+			'public' => 1,
37
+		];
38 38
 
39
-        return $this
40
-            ->connections
41
-            ->getRead()
42
-            ->fetchAll($query, $bindings);
43
-    }
39
+		return $this
40
+			->connections
41
+			->getRead()
42
+			->fetchAll($query, $bindings);
43
+	}
44 44
 }
Please login to merge, or discard this patch.