Completed
Push — master ( 7e42fe...9ab714 )
by Jacob
04:00
created
utility/content/FixInternalLinkContent.class.inc.php 4 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -23,6 +23,9 @@
 block discarded – undo
23 23
 		return;
24 24
 	}
25 25
 
26
+	/**
27
+	 * @param boolean $is_absolute
28
+	 */
26 29
 	private function get_link($string, $is_absolute, $anchor = '')
27 30
 	{
28 31
 		list($type, $uri) = explode('/', $string, 2);
Please login to merge, or discard this patch.
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -72,38 +72,38 @@
 block discarded – undo
72 72
 				
73 73
 				break;
74 74
 			case 'falls' :
75
-                $pieces = explode('/', $uri);
76
-                if (count($pieces) == 1) {
77
-                    Loader::load('collector', 'waterfall/WatercourseCollector');
78
-                    list ($watercourse_alias) = $pieces;
79
-                    $watercourse = WatercourseCollector::getByAlias($watercourse_alias);
75
+				$pieces = explode('/', $uri);
76
+				if (count($pieces) == 1) {
77
+					Loader::load('collector', 'waterfall/WatercourseCollector');
78
+					list ($watercourse_alias) = $pieces;
79
+					$watercourse = WatercourseCollector::getByAlias($watercourse_alias);
80 80
                     
81
-                    if ($watercourse == null) {
82
-                        return;
83
-                    }
81
+					if ($watercourse == null) {
82
+						return;
83
+					}
84 84
                     
85
-                    $link .= ($is_absolute) ? Loader::getRootURL('waterfalls') : '/';
86
-                    $link .= "{$watercourse->alias}/";
85
+					$link .= ($is_absolute) ? Loader::getRootURL('waterfalls') : '/';
86
+					$link .= "{$watercourse->alias}/";
87 87
                     
88
-                    if ($anchor == '') {
89
-                        $anchor = $watercourse->name;
90
-                    }
91
-                } else if (count($pieces) == 2) {
92
-                    Loader::load('collector', 'waterfall/WaterfallCollector');
93
-                    list ($watercourse_alias, $waterfall_alias) = $pieces;
94
-                    $waterfall = WaterfallCollector::getByAlias($watercourse_alias, $waterfall_alias);
88
+					if ($anchor == '') {
89
+						$anchor = $watercourse->name;
90
+					}
91
+				} else if (count($pieces) == 2) {
92
+					Loader::load('collector', 'waterfall/WaterfallCollector');
93
+					list ($watercourse_alias, $waterfall_alias) = $pieces;
94
+					$waterfall = WaterfallCollector::getByAlias($watercourse_alias, $waterfall_alias);
95 95
                     
96
-                    if ($waterfall == null) {
97
-                        return;
98
-                    }
96
+					if ($waterfall == null) {
97
+						return;
98
+					}
99 99
                     
100
-                    $link .= ($is_absolute) ? Loader::getRootURL('waterfalls') : '/';
101
-                    $link .= "{$waterfall->watercourse_alias}/{$waterfall->alias}/";
100
+					$link .= ($is_absolute) ? Loader::getRootURL('waterfalls') : '/';
101
+					$link .= "{$waterfall->watercourse_alias}/{$waterfall->alias}/";
102 102
                     
103
-                    if ($anchor == '') {
104
-                        $anchor = $waterfall->name;
105
-                    }
106
-                }
103
+					if ($anchor == '') {
104
+						$anchor = $waterfall->name;
105
+					}
106
+				}
107 107
 				break;
108 108
 			default :
109 109
 				break;
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
 	protected function execute($is_absolute = true)
13 13
 	{
14 14
 		preg_match_all(self::$LINK_PLACEHOLDER_MATCH, $this->content, $matches);
15
-		foreach($matches[1] as $key => $match)
15
+		foreach ($matches[1] as $key => $match)
16 16
 		{
17
-			if(isset($matches[3][$key]))
17
+			if (isset($matches[3][$key]))
18 18
 				$link_content = $this->get_link($match, $is_absolute, $matches[3][$key]);
19 19
 			else
20 20
 				$link_content = $this->get_link($match, $is_absolute);
@@ -29,19 +29,19 @@  discard block
 block discarded – undo
29 29
 		
30 30
 		$link = '';
31 31
 		
32
-		switch($type)
32
+		switch ($type)
33 33
 		{
34 34
 			case 'blog' :
35 35
 				Loader::load('collector', 'blog/PostCollector');
36 36
 				$post = PostCollector::getPostByURI($uri);
37 37
 				
38
-				if($post === NULL)
38
+				if ($post === NULL)
39 39
 					return;
40 40
 				
41 41
 				$link .= ($is_absolute) ? Loader::getRootURL('blog') : '/';
42 42
 				$link .= "{$post->category}/{$post->path}/";
43 43
 				
44
-				if($anchor == '')
44
+				if ($anchor == '')
45 45
 					$anchor = $post->title;
46 46
 				
47 47
 				break;
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 				$link .= ($is_absolute) ? Loader::getRootURL('blog') : '/';
50 50
 				$link .= "tag/{$uri}/";
51 51
 				
52
-				if($anchor == '')
52
+				if ($anchor == '')
53 53
 				{
54 54
 					$anchor = $uri;
55 55
 					$anchor = str_replace('-', ' ', $anchor);
@@ -61,13 +61,13 @@  discard block
 block discarded – undo
61 61
 				Loader::load('collector', 'waterfall/LogCollector');
62 62
 				$log = LogCollector::getByAlias($uri);
63 63
 				
64
-				if($log === NULL)
64
+				if ($log === NULL)
65 65
 					return;
66 66
 				
67 67
 				$link .= ($is_absolute) ? Loader::getRootURL('waterfalls') : '/';
68 68
 				$link .= "journal/{$log->alias}/";
69 69
 				
70
-				if($anchor == '')
70
+				if ($anchor == '')
71 71
 					$anchor = $log->title;
72 72
 				
73 73
 				break;
Please login to merge, or discard this patch.
Braces   +17 added lines, -12 removed lines patch added patch discarded remove patch
@@ -14,10 +14,11 @@  discard block
 block discarded – undo
14 14
 		preg_match_all(self::$LINK_PLACEHOLDER_MATCH, $this->content, $matches);
15 15
 		foreach($matches[1] as $key => $match)
16 16
 		{
17
-			if(isset($matches[3][$key]))
18
-				$link_content = $this->get_link($match, $is_absolute, $matches[3][$key]);
19
-			else
20
-				$link_content = $this->get_link($match, $is_absolute);
17
+			if(isset($matches[3][$key])) {
18
+							$link_content = $this->get_link($match, $is_absolute, $matches[3][$key]);
19
+			} else {
20
+							$link_content = $this->get_link($match, $is_absolute);
21
+			}
21 22
 			$this->content = str_replace($matches[0][$key], $link_content, $this->content);
22 23
 		}
23 24
 		return;
@@ -35,14 +36,16 @@  discard block
 block discarded – undo
35 36
 				Loader::load('collector', 'blog/PostCollector');
36 37
 				$post = PostCollector::getPostByURI($uri);
37 38
 				
38
-				if($post === NULL)
39
-					return;
39
+				if($post === NULL) {
40
+									return;
41
+				}
40 42
 				
41 43
 				$link .= ($is_absolute) ? Loader::getRootURL('blog') : '/';
42 44
 				$link .= "{$post->category}/{$post->path}/";
43 45
 				
44
-				if($anchor == '')
45
-					$anchor = $post->title;
46
+				if($anchor == '') {
47
+									$anchor = $post->title;
48
+				}
46 49
 				
47 50
 				break;
48 51
 			case 'blog-tag' :
@@ -61,14 +64,16 @@  discard block
 block discarded – undo
61 64
 				Loader::load('collector', 'waterfall/LogCollector');
62 65
 				$log = LogCollector::getByAlias($uri);
63 66
 				
64
-				if($log === NULL)
65
-					return;
67
+				if($log === NULL) {
68
+									return;
69
+				}
66 70
 				
67 71
 				$link .= ($is_absolute) ? Loader::getRootURL('waterfalls') : '/';
68 72
 				$link .= "journal/{$log->alias}/";
69 73
 				
70
-				if($anchor == '')
71
-					$anchor = $log->title;
74
+				if($anchor == '') {
75
+									$anchor = $log->title;
76
+				}
72 77
 				
73 78
 				break;
74 79
 			case 'falls' :
Please login to merge, or discard this patch.
utility/content/FixPhotoContent.class.inc.php 4 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -26,6 +26,10 @@
 block discarded – undo
26 26
 		return Loader::getImagePath('photo', $path);
27 27
 	}
28 28
 
29
+	/**
30
+	 * @param string $size
31
+	 * @param boolean $is_absolute
32
+	 */
29 33
 	private function get_photo_content($string, $size, $is_absolute)
30 34
 	{
31 35
 		list($category, $file_name) = explode('/', $string);
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,9 +44,9 @@
 block discarded – undo
44 44
 		$width = $file_size[0];
45 45
 		$description = $photo_result->description;
46 46
         
47
-        if ($description == '') {
48
-            Debugger::logMessage("No description for {$category}/{$photo}");
49
-        }
47
+		if ($description == '') {
48
+			Debugger::logMessage("No description for {$category}/{$photo}");
49
+		}
50 50
 		
51 51
 		$domain = '/';
52 52
 		if($is_absolute)
Please login to merge, or discard this patch.
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.
src/Domain/Blog/Post/MysqlPostRepository.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 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
     {
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      * @param string $category
23 23
      * @param string $path
24 24
      *
25
-     * @return array|false
25
+     * @return boolean
26 26
      */
27 27
     public function findByPath($category, $path)
28 28
     {
Please login to merge, or discard this patch.
Indentation   +136 added lines, -136 removed lines patch added patch discarded remove patch
@@ -7,165 +7,165 @@  discard block
 block discarded – undo
7 7
 class MysqlPostRepository implements PostRepository
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
-    /**
22
-     * @param string $category
23
-     * @param string $path
24
-     *
25
-     * @return array|false
26
-     */
27
-    public function findPostByPath($category, $path)
28
-    {
29
-        $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
+	/**
22
+	 * @param string $category
23
+	 * @param string $path
24
+	 *
25
+	 * @return array|false
26
+	 */
27
+	public function findPostByPath($category, $path)
28
+	{
29
+		$query = "
30 30
             SELECT `id`, `title`, `path`, `date`, `body`, `category`
31 31
             FROM `jpemeric_blog`.`post`
32 32
             WHERE `path` = :path AND `category` = :category AND `display` = :is_active
33 33
             LIMIT 1";
34
-        $bindings = [
35
-            'path'      => $path,
36
-            'category'  => $category,
37
-            'is_active' => 1,
38
-        ];
39
-
40
-        return $this
41
-            ->connections
42
-            ->getRead()
43
-            ->fetchOne($query, $bindings);
44
-    }
45
-
46
-    public function getActivePosts($limit = null, $offset = 0)
47
-    {
48
-        $query = "
34
+		$bindings = [
35
+			'path'      => $path,
36
+			'category'  => $category,
37
+			'is_active' => 1,
38
+		];
39
+
40
+		return $this
41
+			->connections
42
+			->getRead()
43
+			->fetchOne($query, $bindings);
44
+	}
45
+
46
+	public function getActivePosts($limit = null, $offset = 0)
47
+	{
48
+		$query = "
49 49
             SELECT `id`, `title`, `path`, `date`, `body`, `category`
50 50
             FROM `jpemeric_blog`.`post`
51 51
             WHERE `display` = :is_active
52 52
             ORDER BY `date` DESC";
53
-        if ($limit != null) {
54
-            $query .= "
53
+		if ($limit != null) {
54
+			$query .= "
55 55
             LIMIT {$offset}, {$limit}";
56
-        }
56
+		}
57 57
 
58
-        $bindings = [
59
-            'is_active' => 1,
60
-        ];
58
+		$bindings = [
59
+			'is_active' => 1,
60
+		];
61 61
 
62
-        return $this
63
-            ->connections
64
-            ->getRead()
65
-            ->fetchAll($query, $bindings);
66
-    }
62
+		return $this
63
+			->connections
64
+			->getRead()
65
+			->fetchAll($query, $bindings);
66
+	}
67 67
 
68
-    public function getActivePostsCount()
69
-    {
70
-        $query = "
68
+	public function getActivePostsCount()
69
+	{
70
+		$query = "
71 71
             SELECT COUNT(1) AS `count`
72 72
             FROM `jpemeric_blog`.`post`
73 73
             WHERE `display` = :is_active";
74
-        $bindings = [
75
-            'is_active' => 1,
76
-        ];
77
-
78
-        return $this
79
-            ->connections
80
-            ->getRead()
81
-            ->fetchValue($query, $bindings);
82
-    }
83
-
84
-    public function getActivePostsByTag($tag, $limit = null, $offset = 0)
85
-    {
86
-        $query = "
74
+		$bindings = [
75
+			'is_active' => 1,
76
+		];
77
+
78
+		return $this
79
+			->connections
80
+			->getRead()
81
+			->fetchValue($query, $bindings);
82
+	}
83
+
84
+	public function getActivePostsByTag($tag, $limit = null, $offset = 0)
85
+	{
86
+		$query = "
87 87
             SELECT `id`, `title`, `path`, `date`, `body`, `category`
88 88
             FROM `jpemeric_blog`.`post`
89 89
             INNER JOIN `jpemeric_blog`.`ptlink` ON `ptlink`.`post_id` = `post`.`id` AND
90 90
                                                    `ptlink`.`tag_id` = :tag_id
91 91
             WHERE `display` = :is_active";
92
-        if ($limit != null) {
93
-            $query .= "
92
+		if ($limit != null) {
93
+			$query .= "
94 94
             LIMIT {$offset}, {$limit}";
95
-        }
96
-
97
-        $bindings = [
98
-            'tag_id'    => $tag,
99
-            'is_active' => 1,
100
-        ];
101
-
102
-        return $this
103
-            ->connections
104
-            ->getRead()
105
-            ->fetchAll($query, $bindings);
106
-    }
107
-
108
-    public function getActivePostsCountByTag($tag)
109
-    {
110
-        $query = "
95
+		}
96
+
97
+		$bindings = [
98
+			'tag_id'    => $tag,
99
+			'is_active' => 1,
100
+		];
101
+
102
+		return $this
103
+			->connections
104
+			->getRead()
105
+			->fetchAll($query, $bindings);
106
+	}
107
+
108
+	public function getActivePostsCountByTag($tag)
109
+	{
110
+		$query = "
111 111
             SELECT COUNT(1) AS `count`
112 112
             FROM `jpemeric_blog`.`post`
113 113
             INNER JOIN `jpemeric_blog`.`ptlink` ON `ptlink`.`post_id` = `post`.`id` AND
114 114
                                                    `ptlink`.`tag_id` = :tag_id
115 115
             WHERE `display` = :is_active";
116
-        $bindings = [
117
-            'tag_id'    => $tag,
118
-            'is_active' => 1,
119
-        ];
120
-
121
-        return $this
122
-            ->connections
123
-            ->getRead()
124
-            ->fetchValue($query, $bindings);
125
-    }
126
-
127
-    public function getActivePostsByCategory($category, $limit = null, $offset = 0)
128
-    {
129
-        $query = "
116
+		$bindings = [
117
+			'tag_id'    => $tag,
118
+			'is_active' => 1,
119
+		];
120
+
121
+		return $this
122
+			->connections
123
+			->getRead()
124
+			->fetchValue($query, $bindings);
125
+	}
126
+
127
+	public function getActivePostsByCategory($category, $limit = null, $offset = 0)
128
+	{
129
+		$query = "
130 130
             SELECT `id`, `title`, `path`, `date`, `body`, `category`
131 131
             FROM `jpemeric_blog`.`post`
132 132
             WHERE `category` = :category AND `display` = :is_active";
133
-        if ($limit != null) {
134
-            $query .= "
133
+		if ($limit != null) {
134
+			$query .= "
135 135
             LIMIT {$offset}, {$limit}";
136
-        }
137
-
138
-        $bindings = [
139
-            'category'  => $category,
140
-            'is_active' => 1,
141
-        ];
142
-
143
-        return $this
144
-            ->connections
145
-            ->getRead()
146
-            ->fetchAll($query, $bindings);
147
-    }
148
-
149
-    public function getActivePostsCountByCategory($category)
150
-    {
151
-        $query = "
136
+		}
137
+
138
+		$bindings = [
139
+			'category'  => $category,
140
+			'is_active' => 1,
141
+		];
142
+
143
+		return $this
144
+			->connections
145
+			->getRead()
146
+			->fetchAll($query, $bindings);
147
+	}
148
+
149
+	public function getActivePostsCountByCategory($category)
150
+	{
151
+		$query = "
152 152
             SELECT COUNT(1) AS `count`
153 153
             FROM `jpemeric_blog`.`post`
154 154
             WHERE `category` = :category AND `display` = :is_active";
155
-        $bindings = [
156
-            'category'  => $category,
157
-            'is_active' => 1,
158
-        ];
159
-
160
-        return $this
161
-            ->connections
162
-            ->getRead()
163
-            ->fetchValue($query, $bindings);
164
-    }
165
-
166
-    public function getActivePostsByRelatedTags($post, $limit = 4)
167
-    {
168
-        $query = "
155
+		$bindings = [
156
+			'category'  => $category,
157
+			'is_active' => 1,
158
+		];
159
+
160
+		return $this
161
+			->connections
162
+			->getRead()
163
+			->fetchValue($query, $bindings);
164
+	}
165
+
166
+	public function getActivePostsByRelatedTags($post, $limit = 4)
167
+	{
168
+		$query = "
169 169
             SELECT `id`, `title`, `path`, `date`, `body`, `category`, COUNT(1) AS `count`
170 170
             FROM `jpemeric_blog`.`post`
171 171
             INNER JOIN `jpemeric_blog`.`ptlink` ON `ptlink`.`post_id` = `post`.`id` AND
@@ -185,14 +185,14 @@  discard block
 block discarded – undo
185 185
             GROUP BY `id`
186 186
             ORDER BY `count` DESC
187 187
             LIMIT {$limit}";
188
-        $bindings = [
189
-            'post'      => $post,
190
-            'is_active' => 1,
191
-        ];
192
-
193
-        return $this
194
-            ->connections
195
-            ->getRead()
196
-            ->fetchAll($query, $bindings);
197
-    }
188
+		$bindings = [
189
+			'post'      => $post,
190
+			'is_active' => 1,
191
+		];
192
+
193
+		return $this
194
+			->connections
195
+			->getRead()
196
+			->fetchAll($query, $bindings);
197
+	}
198 198
 }
Please login to merge, or discard this patch.
src/Domain/Blog/Post/PostRepositoryInterface.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -4,12 +4,12 @@
 block discarded – undo
4 4
 
5 5
 interface PostRepository
6 6
 {
7
-    public function findPostByPath($category, $path);
8
-    public function getActivePosts($limit = null, $offset= 0);
9
-    public function getActivePostsCount();
10
-    public function getActivePostsByTag($tag, $limit = null, $offset = 0);
11
-    public function getActivePostsCountByTag($tag);
12
-    public function getActivePostsByCategory($category, $limit = null, $offset = 0);
13
-    public function getActivePostsCountByCategory($category);
14
-    public function getActivePostsByRelatedTags($post, $limit = 4);
7
+	public function findPostByPath($category, $path);
8
+	public function getActivePosts($limit = null, $offset= 0);
9
+	public function getActivePostsCount();
10
+	public function getActivePostsByTag($tag, $limit = null, $offset = 0);
11
+	public function getActivePostsCountByTag($tag);
12
+	public function getActivePostsByCategory($category, $limit = null, $offset = 0);
13
+	public function getActivePostsCountByCategory($category);
14
+	public function getActivePostsByRelatedTags($post, $limit = 4);
15 15
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 interface PostRepository
6 6
 {
7 7
     public function findPostByPath($category, $path);
8
-    public function getActivePosts($limit = null, $offset= 0);
8
+    public function getActivePosts($limit = null, $offset = 0);
9 9
     public function getActivePostsCount();
10 10
     public function getActivePostsByTag($tag, $limit = null, $offset = 0);
11 11
     public function getActivePostsCountByTag($tag);
Please login to merge, or discard this patch.
src/Domain/Blog/Series/MysqlSeriesRepository.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -7,25 +7,25 @@  discard block
 block discarded – undo
7 7
 class MysqlSeriesRepository implements SeriesRepository
8 8
 {
9 9
 
10
-    /** @var  Aura\Sql\ConnectionLocator */
11
-    protected $connections;
10
+	/** @var  Aura\Sql\ConnectionLocator */
11
+	protected $connections;
12 12
 
13
-    /**
14
-     * @param Aura\Sql\ConnectionLocator
15
-     */
16
-    public function __construct(ConnectionLocator $connections)
17
-    {
18
-        $this->connections = $connections;
19
-    }
13
+	/**
14
+	 * @param Aura\Sql\ConnectionLocator
15
+	 */
16
+	public function __construct(ConnectionLocator $connections)
17
+	{
18
+		$this->connections = $connections;
19
+	}
20 20
 
21
-    /**
22
-     * @param integer $post
23
-     *
24
-     * @return array|false
25
-     */
26
-    public function getSeriesForPost($post)
27
-    {
28
-        $query = "
21
+	/**
22
+	 * @param integer $post
23
+	 *
24
+	 * @return array|false
25
+	 */
26
+	public function getSeriesForPost($post)
27
+	{
28
+		$query = "
29 29
             SELECT `series`.`title` AS `series_title`, `series`.`description` AS `series_descriptions`,
30 30
                    `post.id` AS `post`, `post`.`title`, `post`.`category`, `post`.`path`
31 31
             FROM `jpemeric_blog`.`series`
@@ -38,14 +38,14 @@  discard block
 block discarded – undo
38 38
                 WHERE `post` = :lookup_post
39 39
                 LIMIT 1)
40 40
             ORDER BY `series_post`.`order`";
41
-        $bindings = [
42
-            'is_active'   => 1,
43
-            'lookup_post' => $post,
44
-        ];
41
+		$bindings = [
42
+			'is_active'   => 1,
43
+			'lookup_post' => $post,
44
+		];
45 45
 
46
-        return $this
47
-            ->connections
48
-            ->getRead()
49
-            ->fetchAll($query, $bindings);
50
-    }
46
+		return $this
47
+			->connections
48
+			->getRead()
49
+			->fetchAll($query, $bindings);
50
+	}
51 51
 }
Please login to merge, or discard this patch.
src/Domain/Blog/Series/SeriesRepositoryInterface.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,5 +4,5 @@
 block discarded – undo
4 4
 
5 5
 interface SeriesRepository
6 6
 {
7
-    public function getSeriesForPost($post);
7
+	public function getSeriesForPost($post);
8 8
 }
Please login to merge, or discard this patch.
src/Domain/Blog/Tag/MysqlTagRepository.php 1 patch
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -7,85 +7,85 @@
 block discarded – undo
7 7
 class MysqlTagRepository implements TagRepository
8 8
 {
9 9
 
10
-    /** @var  Aura\Sql\ConnectionLocator */
11
-    protected $connections;
10
+	/** @var  Aura\Sql\ConnectionLocator */
11
+	protected $connections;
12 12
 
13
-    /**
14
-     * @param Aura\Sql\ConnectionLocator
15
-     */
16
-    public function __construct(ConnectionLocator $connections)
17
-    {
18
-        $this->connections = $connections;
19
-    }
13
+	/**
14
+	 * @param Aura\Sql\ConnectionLocator
15
+	 */
16
+	public function __construct(ConnectionLocator $connections)
17
+	{
18
+		$this->connections = $connections;
19
+	}
20 20
 
21
-    /**
22
-     * @param string $title
23
-     *
24
-     * @return array|false
25
-     */
26
-    public function findTagByTitle($title)
27
-    {
28
-        $query = "
21
+	/**
22
+	 * @param string $title
23
+	 *
24
+	 * @return array|false
25
+	 */
26
+	public function findTagByTitle($title)
27
+	{
28
+		$query = "
29 29
             SELECT *
30 30
             FROM `jpemeric_blog`.`tag`
31 31
             WHERE `tag` = :title
32 32
             LIMIT 1";
33
-        $bindings = [
34
-            'title' => $title,
35
-        ];
33
+		$bindings = [
34
+			'title' => $title,
35
+		];
36 36
 
37
-        return $this
38
-            ->connections
39
-            ->getRead()
40
-            ->fetchOne($query, $bindings);
41
-    }
37
+		return $this
38
+			->connections
39
+			->getRead()
40
+			->fetchOne($query, $bindings);
41
+	}
42 42
 
43
-    public function getAllTags()
44
-    {
45
-        $query = "
43
+	public function getAllTags()
44
+	{
45
+		$query = "
46 46
             SELECT *
47 47
             FROM `jpemeric_blog`.`tag`
48 48
             ORDER BY `tag`";
49 49
 
50
-        return $this
51
-            ->connections
52
-            ->getRead()
53
-            ->fetchAll($query);
54
-    }
50
+		return $this
51
+			->connections
52
+			->getRead()
53
+			->fetchAll($query);
54
+	}
55 55
 
56
-    public function getTagCloud()
57
-    {
58
-        $query = "
56
+	public function getTagCloud()
57
+	{
58
+		$query = "
59 59
             SELECT COUNT(1) AS `count`, `tag`
60 60
             FROM `jpemeric_blog`.`tag`
61 61
             INNER JOIN `jpemeric_blog`.`ptlink` ON `ptlink`.`tag_id` = `tag`.`id`
62 62
             INNER JOIN `jpemeric_blog`.`post` ON `post`.`id` = `ptlink`.`post_id` AND
63 63
                                                  `post`.`display` = :is_active
64 64
             GROUP BY `tag`";
65
-        $bindings = [
66
-            'is_active' => 1,
67
-        ];
65
+		$bindings = [
66
+			'is_active' => 1,
67
+		];
68 68
 
69
-        return $this
70
-            ->connections
71
-            ->getRead()
72
-            ->fetchAll($query, $bindings);
73
-    }
69
+		return $this
70
+			->connections
71
+			->getRead()
72
+			->fetchAll($query, $bindings);
73
+	}
74 74
 
75
-    public function getTagsForPost($post)
76
-    {
77
-        $query = "
75
+	public function getTagsForPost($post)
76
+	{
77
+		$query = "
78 78
             SELECT `tag`.*
79 79
             FROM `jpemeric_blog`.`tag`
80 80
             INNER JOIN `jpemeric_blog`.`ptlink` ON `ptlink`.`tag_id` AND `post_id` = :post
81 81
             ORDER BY `tag`";
82
-        $bindings = [
83
-            'post' => $post,
84
-        ];
82
+		$bindings = [
83
+			'post' => $post,
84
+		];
85 85
 
86
-        return $this
87
-            ->connections
88
-            ->getRead()
89
-            ->fetchAll($query, $bindings);
90
-    }
86
+		return $this
87
+			->connections
88
+			->getRead()
89
+			->fetchAll($query, $bindings);
90
+	}
91 91
 }
Please login to merge, or discard this patch.
src/Domain/Blog/Tag/TagRepositoryInterface.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 
5 5
 interface TagRepository
6 6
 {
7
-    public function findTagByTitle($title);
8
-    public function getAllTags();
9
-    public function getTagCloud();
10
-    public function getTagsForPost($post);
7
+	public function findTagByTitle($title);
8
+	public function getAllTags();
9
+	public function getTagCloud();
10
+	public function getTagsForPost($post);
11 11
 }
Please login to merge, or discard this patch.
src/Domain/Blog/Introduction/IntroductionRepositoryInterface.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,5 +4,5 @@
 block discarded – undo
4 4
 
5 5
 interface IntroductionRepository
6 6
 {
7
-    public function findByType($type, $value = '');
7
+	public function findByType($type, $value = '');
8 8
 }
Please login to merge, or discard this patch.