Completed
Branch master (de1ee7)
by Jacob
05:01
created
controller/blog/PostController.class.inc.php 1 patch
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -27,8 +27,9 @@  discard block
 block discarded – undo
27 27
 		parent::__construct();
28 28
 		
29 29
 		$this->post = PostCollector::getPostByURI(URLDecode::getPiece(2));
30
-		if($this->post == null)
31
-			$this->eject();
30
+		if($this->post == null) {
31
+					$this->eject();
32
+		}
32 33
 		
33 34
 		$this->handle_comment_submit(
34 35
 			self::$BLOG_SITE_ID,
@@ -103,8 +104,9 @@  discard block
 block discarded – undo
103 104
 	private function get_series_posts()
104 105
 	{
105 106
 		$series_posts = $this->fetch_series_posts();
106
-		if(count($series_posts) < 1)
107
-			return array();
107
+		if(count($series_posts) < 1) {
108
+					return array();
109
+		}
108 110
 		
109 111
 		$previous_post = new stdclass();
110 112
 		$next_post = new stdclass();
@@ -132,9 +134,9 @@  discard block
 block discarded – undo
132 134
 
133 135
 			$post->url = Loader::getRootUrl('blog') . "{$post_row->category}/{$post_row->path}/";
134 136
 			
135
-			if(!$found_current_post)
136
-				$previous_post = $post;
137
-			else
137
+			if(!$found_current_post) {
138
+							$previous_post = $post;
139
+			} else
138 140
 			{
139 141
 				$next_post = $post;
140 142
 				break;
@@ -151,8 +153,9 @@  discard block
 block discarded – undo
151 153
 	private $series_posts;
152 154
 	private function fetch_series_posts()
153 155
 	{
154
-		if(!isset($this->series_posts))
155
-			$this->series_posts = SeriesCollector::getSeriesForPost($this->post->id);
156
+		if(!isset($this->series_posts)) {
157
+					$this->series_posts = SeriesCollector::getSeriesForPost($this->post->id);
158
+		}
156 159
 		return $this->series_posts;
157 160
 	}
158 161
 
Please login to merge, or discard this patch.
controller/blog/SearchController.class.inc.php 1 patch
Braces   +23 added lines, -18 removed lines patch added patch discarded remove patch
@@ -49,8 +49,7 @@  discard block
 block discarded – undo
49 49
 		{
50 50
 			$this->set_title(sprintf(self::$TITLE_MAIN, ucwords($this->query)));
51 51
 			$this->set_description(sprintf(self::$DESCRIPTION_MAIN, ucwords($this->query)));
52
-		}
53
-		else
52
+		} else
54 53
 		{
55 54
 			$this->set_title(sprintf(self::$TITLE_PAGINATED, ucwords($this->query), $this->page, $this->total_pages));
56 55
 			$this->set_description(sprintf(self::$DESCRIPTION_PAGINATED, $this->page, $this->total_pages, ucwords($this->query)));
@@ -63,22 +62,24 @@  discard block
 block discarded – undo
63 62
 
64 63
 	protected function get_introduction()
65 64
 	{
66
-		if($this->total_pages > 1)
67
-			return array(
65
+		if($this->total_pages > 1) {
66
+					return array(
68 67
 				'title' => "Posts from search '{$this->query}', page {$this->page} of {$this->total_pages}.");
69
-		else if($this->total_pages == 1)
70
-			return array(
68
+		} else if($this->total_pages == 1) {
69
+					return array(
71 70
 				'title' => "Posts from search '{$this->query}'.");
72
-		else
73
-			return array(
71
+		} else {
72
+					return array(
74 73
 				'title' => "Sorry, '{$this->query}' didn't return any posts.");
74
+		}
75 75
 	}
76 76
 
77 77
 	protected function get_page_number()
78 78
 	{
79 79
 		$page = URLDecode::getPiece(3);
80
-		if(isset($page) && is_numeric($page))
81
-			return $page;
80
+		if(isset($page) && is_numeric($page)) {
81
+					return $page;
82
+		}
82 83
 		return 1;
83 84
 	}
84 85
 
@@ -113,25 +114,29 @@  discard block
 block discarded – undo
113 114
 
114 115
 	protected function get_list_next_link()
115 116
 	{
116
-		if($this->page == 1)
117
-			return;
118
-		if($this->page == 2)
119
-			return Content::instance('URLSafe', "/search/{$this->query}/")->activate();
117
+		if($this->page == 1) {
118
+					return;
119
+		}
120
+		if($this->page == 2) {
121
+					return Content::instance('URLSafe', "/search/{$this->query}/")->activate();
122
+		}
120 123
 		return Content::instance('URLSafe', "/search/{$this->query}/" . ($this->page - 1) . '/')->activate();
121 124
 	}
122 125
 
123 126
 	protected function get_list_prev_link()
124 127
 	{
125
-		if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count())
126
-			return;
128
+		if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) {
129
+					return;
130
+		}
127 131
 		return Content::instance('URLSafe', "/search/{$this->query}/" . ($this->page + 1) . '/')->activate();
128 132
 	}
129 133
 
130 134
 	private $total_post_count;
131 135
 	protected function get_total_post_count()
132 136
 	{
133
-		if(!isset($this->total_post_count))
134
-			$this->total_post_count = count($this->get_search_result());
137
+		if(!isset($this->total_post_count)) {
138
+					$this->total_post_count = count($this->get_search_result());
139
+		}
135 140
 		return $this->total_post_count;
136 141
 	}
137 142
 
Please login to merge, or discard this patch.
controller/blog/TagController.class.inc.php 1 patch
Braces   +19 added lines, -14 removed lines patch added patch discarded remove patch
@@ -28,8 +28,9 @@  discard block
 block discarded – undo
28 28
 		$tag = str_replace('-', ' ', $tag);
29 29
 		
30 30
 		$tag_result = TagCollector::getSingleTag($tag);
31
-		if($tag_result === false)
32
-			$this->eject();
31
+		if($tag_result === false) {
32
+					$this->eject();
33
+		}
33 34
 		
34 35
 		$this->tag = $tag_result;
35 36
 		
@@ -44,8 +45,7 @@  discard block
 block discarded – undo
44 45
 		{
45 46
 			$this->set_title(sprintf(self::$TITLE_MAIN, ucwords($this->tag->tag)));
46 47
 			$this->set_description(sprintf(self::$DESCRIPTION_MAIN, ucwords($this->tag->tag)));
47
-		}
48
-		else
48
+		} else
49 49
 		{
50 50
 			$this->set_title(sprintf(self::$TITLE_PAGINATED, ucwords($this->tag->tag), $this->page, $this->total_pages));
51 51
 			$this->set_description(sprintf(self::$DESCRIPTION_PAGINATED, $this->page, $this->total_pages, ucwords($this->tag->tag)));
@@ -86,8 +86,9 @@  discard block
 block discarded – undo
86 86
 	protected function get_page_number()
87 87
 	{
88 88
 		$page = URLDecode::getPiece(3);
89
-		if(isset($page) && is_numeric($page))
90
-			return $page;
89
+		if(isset($page) && is_numeric($page)) {
90
+					return $page;
91
+		}
91 92
 		return 1;
92 93
 	}
93 94
 
@@ -106,25 +107,29 @@  discard block
 block discarded – undo
106 107
 
107 108
 	protected function get_list_next_link()
108 109
 	{
109
-		if($this->page == 1)
110
-			return;
111
-		if($this->page == 2)
112
-			return Content::instance('URLSafe', "/tag/{$this->tag->tag}/")->activate();
110
+		if($this->page == 1) {
111
+					return;
112
+		}
113
+		if($this->page == 2) {
114
+					return Content::instance('URLSafe', "/tag/{$this->tag->tag}/")->activate();
115
+		}
113 116
 		return Content::instance('URLSafe', "/tag/{$this->tag->tag}/" . ($this->page - 1) . '/')->activate();
114 117
 	}
115 118
 
116 119
 	protected function get_list_prev_link()
117 120
 	{
118
-		if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count())
119
-			return;
121
+		if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) {
122
+					return;
123
+		}
120 124
 		return Content::instance('URLSafe', "/tag/{$this->tag->tag}/" . ($this->page + 1) . '/')->activate();
121 125
 	}
122 126
 
123 127
 	private $total_post_count;
124 128
 	protected function get_total_post_count()
125 129
 	{
126
-		if(!isset($this->total_post_count))
127
-			$this->total_post_count = PostCollector::getPostCountForTag($this->tag->id);
130
+		if(!isset($this->total_post_count)) {
131
+					$this->total_post_count = PostCollector::getPostCountForTag($this->tag->id);
132
+		}
128 133
 		return $this->total_post_count;
129 134
 	}
130 135
 
Please login to merge, or discard this patch.
controller/home/ContactController.class.inc.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -35,17 +35,21 @@
 block discarded – undo
35 35
 
36 36
 	private function process_form()
37 37
 	{
38
-		if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!')
39
-			return (object) array('display' => 'normal');
38
+		if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!') {
39
+					return (object) array('display' => 'normal');
40
+		}
40 41
 		
41 42
 		Loader::load('utility', 'Validate');
42 43
 		$error_result = array();
43
-		if(!Validate::checkRequest('post', 'name', 'string'))
44
-			$error_result['name'] = 'please enter your name';
45
-		if(!Validate::checkRequest('post', 'email', 'string'))
46
-			$error_result['email'] = 'please enter a valid email';
47
-		if(!Validate::checkRequest('post', 'message', 'string'))
48
-			$error_result['message'] = 'please write a message';
44
+		if(!Validate::checkRequest('post', 'name', 'string')) {
45
+					$error_result['name'] = 'please enter your name';
46
+		}
47
+		if(!Validate::checkRequest('post', 'email', 'string')) {
48
+					$error_result['email'] = 'please enter a valid email';
49
+		}
50
+		if(!Validate::checkRequest('post', 'message', 'string')) {
51
+					$error_result['message'] = 'please write a message';
52
+		}
49 53
 		
50 54
 		$values = (object) array(
51 55
 			'name' => Request::getPost('name'),
Please login to merge, or discard this patch.
controller/images/HomeController.class.inc.php 1 patch
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,12 +18,13 @@  discard block
 block discarded – undo
18 18
 		
19 19
 		if(
20 20
 			URLDecode::getSite() == 'images' ||
21
-			URLDecode::getExtension() == 'ico')
22
-			$file = "/css/{$file}";
23
-		else if(URLDecode::getSite() == 'portfolio')
24
-			$file = "/portfolio/{$file}";
25
-		else if(substr($file, 0, 7) == '/photo/')
26
-			$file = '/photo/processed/' . substr($file, 7);
21
+			URLDecode::getExtension() == 'ico') {
22
+					$file = "/css/{$file}";
23
+		} else if(URLDecode::getSite() == 'portfolio') {
24
+					$file = "/portfolio/{$file}";
25
+		} else if(substr($file, 0, 7) == '/photo/') {
26
+					$file = '/photo/processed/' . substr($file, 7);
27
+		}
27 28
 		
28 29
 		$this->use_old_image_logic($file);
29 30
 		
@@ -78,8 +79,9 @@  discard block
 block discarded – undo
78 79
 
79 80
 	protected function eject()
80 81
 	{
81
-		if(get_class($this) !== 'Error404Controller')
82
-			Loader::loadNew('controller', '/Error404Controller')->activate();
82
+		if(get_class($this) !== 'Error404Controller') {
83
+					Loader::loadNew('controller', '/Error404Controller')->activate();
84
+		}
83 85
 	}
84 86
 
85 87
 }
Please login to merge, or discard this patch.
controller/lifestream/DefaultListController.class.inc.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,8 +59,9 @@
 block discarded – undo
59 59
 		{
60 60
 			$post_array[] = $this->expand_post($post, 'full');
61 61
 		}
62
-		if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search')
63
-			$this->eject();
62
+		if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') {
63
+					$this->eject();
64
+		}
64 65
 		return $post_array;
65 66
 	}
66 67
 
Please login to merge, or discard this patch.
controller/lifestream/HomeController.class.inc.php 1 patch
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -38,8 +38,9 @@  discard block
 block discarded – undo
38 38
 	protected function get_page_number()
39 39
 	{
40 40
 		$page = URLDecode::getPiece(2);
41
-		if(isset($page) && is_numeric($page))
42
-			return $page;
41
+		if(isset($page) && is_numeric($page)) {
42
+					return $page;
43
+		}
43 44
 		return 1;
44 45
 	}
45 46
 
@@ -58,25 +59,29 @@  discard block
 block discarded – undo
58 59
 
59 60
 	protected function get_list_next_link()
60 61
 	{
61
-		if($this->page == 1)
62
-			return;
63
-		if($this->page == 2)
64
-			return Loader::getRootUrl('lifestream');
62
+		if($this->page == 1) {
63
+					return;
64
+		}
65
+		if($this->page == 2) {
66
+					return Loader::getRootUrl('lifestream');
67
+		}
65 68
 		return Loader::getRootUrl('lifestream') . 'page/' . ($this->page - 1) . '/';
66 69
 	}
67 70
 
68 71
 	protected function get_list_prev_link()
69 72
 	{
70
-		if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count())
71
-			return;
73
+		if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) {
74
+					return;
75
+		}
72 76
 		return Loader::getRootUrl('lifestream') . 'page/' . ($this->page + 1) . '/';
73 77
 	}
74 78
 
75 79
 	private $total_post_count;
76 80
 	protected function get_total_post_count()
77 81
 	{
78
-		if(!isset($this->total_post_count))
79
-			$this->total_post_count = ActivityCollector::getCount();
82
+		if(!isset($this->total_post_count)) {
83
+					$this->total_post_count = ActivityCollector::getCount();
84
+		}
80 85
 		return $this->total_post_count;
81 86
 	}
82 87
 
Please login to merge, or discard this patch.
controller/lifestream/PostController.class.inc.php 1 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 = ActivityCollector::getPost($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.
controller/lifestream/TagController.class.inc.php 1 patch
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -97,8 +97,9 @@  discard block
 block discarded – undo
97 97
 	protected function get_page_number()
98 98
 	{
99 99
 		$page = URLDecode::getPiece(3);
100
-		if(isset($page) && is_numeric($page))
101
-			return $page;
100
+		if(isset($page) && is_numeric($page)) {
101
+					return $page;
102
+		}
102 103
 		return 1;
103 104
 	}
104 105
 
@@ -117,25 +118,29 @@  discard block
 block discarded – undo
117 118
 
118 119
 	protected function get_list_next_link()
119 120
 	{
120
-		if($this->page == 1)
121
-			return;
122
-		if($this->page == 2)
123
-			return Loader::getRootUrl('lifestream') . $this->tag . '/';
121
+		if($this->page == 1) {
122
+					return;
123
+		}
124
+		if($this->page == 2) {
125
+					return Loader::getRootUrl('lifestream') . $this->tag . '/';
126
+		}
124 127
 		return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page - 1) . '/';
125 128
 	}
126 129
 
127 130
 	protected function get_list_prev_link()
128 131
 	{
129
-		if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count())
130
-			return;
132
+		if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) {
133
+					return;
134
+		}
131 135
 		return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page + 1) . '/';
132 136
 	}
133 137
 
134 138
 	private $total_post_count;
135 139
 	protected function get_total_post_count()
136 140
 	{
137
-		if(!isset($this->total_post_count))
138
-			$this->total_post_count = ActivityCollector::getCountForTag($this->tag);
141
+		if(!isset($this->total_post_count)) {
142
+					$this->total_post_count = ActivityCollector::getCountForTag($this->tag);
143
+		}
139 144
 		return $this->total_post_count;
140 145
 	}
141 146
 
Please login to merge, or discard this patch.