Completed
Push — master ( f92391...2b16eb )
by Jacob
03:12
created
src/Domain/Blog/Post/MysqlPostRepository.php 1 patch
Doc Comments   +14 added lines, -1 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
     {
@@ -43,6 +43,9 @@  discard block
 block discarded – undo
43 43
             ->fetchOne($query, $bindings);
44 44
     }
45 45
 
46
+    /**
47
+     * @param integer $limit
48
+     */
46 49
     public function getActivePosts($limit = null, $offset = 0)
47 50
     {
48 51
         $query = "
@@ -81,6 +84,10 @@  discard block
 block discarded – undo
81 84
             ->fetchValue($query, $bindings);
82 85
     }
83 86
 
87
+    /**
88
+     * @param integer $tag
89
+     * @param integer $limit
90
+     */
84 91
     public function getActivePostsByTag($tag, $limit = null, $offset = 0)
85 92
     {
86 93
         $query = "
@@ -105,6 +112,9 @@  discard block
 block discarded – undo
105 112
             ->fetchAll($query, $bindings);
106 113
     }
107 114
 
115
+    /**
116
+     * @param integer $tag
117
+     */
108 118
     public function getActivePostsCountByTag($tag)
109 119
     {
110 120
         $query = "
@@ -124,6 +134,9 @@  discard block
 block discarded – undo
124 134
             ->fetchValue($query, $bindings);
125 135
     }
126 136
 
137
+    /**
138
+     * @param integer $limit
139
+     */
127 140
     public function getActivePostsByCategory($category, $limit = null, $offset = 0)
128 141
     {
129 142
         $query = "
Please login to merge, or discard this patch.
tests/unit/Domain/Blog/Post/MysqlPostRepositoryTest.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             )"
49 49
         );
50 50
 
51
-        self::$connection = new ConnectionLocator(function () use ($extendedPdo) {
51
+        self::$connection = new ConnectionLocator(function() use ($extendedPdo) {
52 52
             return $extendedPdo;
53 53
         });
54 54
     }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
         $this->assertInternalType('array', $data);
175 175
         $this->assertCount(count($testData), $data);
176 176
 
177
-        usort($testData, function ($rowA, $rowB) {
177
+        usort($testData, function($rowA, $rowB) {
178 178
             return ((new DateTime($rowA['date'])) < (new DateTime($rowB['date'])));
179 179
         });
180 180
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         $this->assertNotFalse($data);
220 220
         $this->assertInternalType('array', $data);
221 221
 
222
-        $testData = array_filter($testData, function ($row) {
222
+        $testData = array_filter($testData, function($row) {
223 223
             return ($row['display'] == 1);
224 224
         });
225 225
 
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
         $this->assertNotFalse($data);
355 355
         $this->assertStringMatchesFormat('%d', $data);
356 356
 
357
-        $testData = array_filter($testData, function ($row) {
357
+        $testData = array_filter($testData, function($row) {
358 358
             return ($row['display'] == 1);
359 359
         });
360 360
 
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
         $this->assertNotFalse($data);
472 472
         $this->assertInternalType('array', $data);
473 473
 
474
-        $testPostData = array_filter($testPostData, function ($row) {
474
+        $testPostData = array_filter($testPostData, function($row) {
475 475
             return ($row['display'] == 1);
476 476
         });
477 477
 
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
         $this->assertNotFalse($data);
672 672
         $this->assertStringMatchesFormat('%d', $data);
673 673
 
674
-        $testPostData = array_filter($testPostData, function ($row) {
674
+        $testPostData = array_filter($testPostData, function($row) {
675 675
             return ($row['display'] == 1);
676 676
         });
677 677
 
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
         $this->assertNotFalse($data);
770 770
         $this->assertInternalType('array', $data);
771 771
 
772
-        $testData = array_filter($testData, function ($row) {
772
+        $testData = array_filter($testData, function($row) {
773 773
             return ($row['display'] == 1);
774 774
         });
775 775
 
@@ -921,7 +921,7 @@  discard block
 block discarded – undo
921 921
         $this->assertNotFalse($data);
922 922
         $this->assertStringMatchesFormat('%d', $data);
923 923
 
924
-        $testData = array_filter($testData, function ($row) {
924
+        $testData = array_filter($testData, function($row) {
925 925
             return ($row['display'] == 1);
926 926
         });
927 927
 
@@ -1109,7 +1109,7 @@  discard block
 block discarded – undo
1109 1109
         $this->assertInternalType('array', $data);
1110 1110
 
1111 1111
         array_shift($testPostData);
1112
-        $testPostData = array_filter($testPostData, function ($row) {
1112
+        $testPostData = array_filter($testPostData, function($row) {
1113 1113
             return ($row['display'] == 1);
1114 1114
         });
1115 1115
 
@@ -1181,7 +1181,7 @@  discard block
 block discarded – undo
1181 1181
         $this->assertInternalType('array', $data);
1182 1182
 
1183 1183
         array_shift($testPostData);
1184
-        $testPostData = array_filter($testPostData, function ($row) use ($testSeriesPostData) {
1184
+        $testPostData = array_filter($testPostData, function($row) use ($testSeriesPostData) {
1185 1185
             return (!in_array($row['id'], array_column($testSeriesPostData, 'post')));
1186 1186
         });
1187 1187
 
Please login to merge, or discard this patch.