@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | * |
| 156 | 156 | * @throws NotFoundHttpException |
| 157 | 157 | * |
| 158 | - * @return Post |
|
| 158 | + * @return FormInterface |
|
| 159 | 159 | */ |
| 160 | 160 | public function postPostAction(Request $request) |
| 161 | 161 | { |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | * |
| 186 | 186 | * @throws NotFoundHttpException |
| 187 | 187 | * |
| 188 | - * @return Post |
|
| 188 | + * @return FormInterface |
|
| 189 | 189 | */ |
| 190 | 190 | public function putPostAction($id, Request $request) |
| 191 | 191 | { |
@@ -356,7 +356,7 @@ |
||
| 356 | 356 | * @param null $commentManager |
| 357 | 357 | * @param null $mailer |
| 358 | 358 | * @param null $formFactory |
| 359 | - * @param null $formatterPool |
|
| 359 | + * @param Pool $formatterPool |
|
| 360 | 360 | * |
| 361 | 361 | * @return PostController |
| 362 | 362 | */ |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | /** |
| 71 | 71 | * Returns a list of functions to add to the existing list. |
| 72 | 72 | * |
| 73 | - * @return array An array of functions |
|
| 73 | + * @return TwigFunction[] An array of functions |
|
| 74 | 74 | */ |
| 75 | 75 | public function getFunctions() |
| 76 | 76 | { |
@@ -29,6 +29,9 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | private $comment; |
| 31 | 31 | |
| 32 | + /** |
|
| 33 | + * @param Request $request |
|
| 34 | + */ |
|
| 32 | 35 | public function __construct(CommentInterface $comment, ?Request $request = null) |
| 33 | 36 | { |
| 34 | 37 | $this->comment = $comment; |
@@ -20,6 +20,7 @@ |
||
| 20 | 20 | { |
| 21 | 21 | /** |
| 22 | 22 | * Update the number of comment for a comment. |
| 23 | + * @return void |
|
| 23 | 24 | */ |
| 24 | 25 | public function updateCommentsCount(PostInterface $post = null); |
| 25 | 26 | } |
@@ -166,6 +166,10 @@ |
||
| 166 | 166 | return $pager; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | + /** |
|
| 170 | + * @param string $date |
|
| 171 | + * @param string $step |
|
| 172 | + */ |
|
| 169 | 173 | public function getPublicationDateQueryParts($date, $step, $alias = 'p') |
| 170 | 174 | { |
| 171 | 175 | return [ |
@@ -81,6 +81,9 @@ |
||
| 81 | 81 | ], 1); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | + /** |
|
| 85 | + * @param \Closure $qbCallback |
|
| 86 | + */ |
|
| 84 | 87 | protected function getCommentManager($qbCallback) |
| 85 | 88 | { |
| 86 | 89 | $em = $this->createEntityManagerMock($qbCallback, []); |
@@ -67,6 +67,9 @@ discard block |
||
| 67 | 67 | ; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | + /** |
|
| 71 | + * @param integer $flag |
|
| 72 | + */ |
|
| 70 | 73 | public function assertPostEnabled($qb, $flag) |
| 71 | 74 | { |
| 72 | 75 | $qb->expects($this->once())->method('andWhere')->with($this->equalTo('p.enabled = :enabled')); |
@@ -254,6 +257,9 @@ discard block |
||
| 254 | 257 | $this->assertSame('2010-03-10', $result['params']['endDate']->format('Y-m-d')); |
| 255 | 258 | } |
| 256 | 259 | |
| 260 | + /** |
|
| 261 | + * @param \Closure $qbCallback |
|
| 262 | + */ |
|
| 257 | 263 | protected function getPostManager($qbCallback) |
| 258 | 264 | { |
| 259 | 265 | $em = $this->createEntityManagerMock($qbCallback, []); |
@@ -132,24 +132,3 @@ |
||
| 132 | 132 | switch ($this->getConnection()->getDriver()->getDatabasePlatform()->getName()) { |
| 133 | 133 | case 'postgresql': |
| 134 | 134 | return sprintf(<<<'SQL' |
| 135 | -UPDATE %s SET comments_count = count_comment.total |
|
| 136 | -FROM (SELECT c.post_id, count(*) AS total FROM %s AS c WHERE c.status = 1 GROUP BY c.post_id) count_comment |
|
| 137 | -WHERE %s.id = count_comment.post_id |
|
| 138 | -SQL, |
|
| 139 | - $postTableName, |
|
| 140 | - $commentTableName, |
|
| 141 | - $postTableName |
|
| 142 | - ); |
|
| 143 | - |
|
| 144 | - default: |
|
| 145 | - return sprintf(<<<'SQL' |
|
| 146 | -UPDATE %s p, (SELECT c.post_id, count(*) as total FROM %s as c WHERE c.status = 1 GROUP BY c.post_id) as count_comment |
|
| 147 | -SET p.comments_count = count_comment.total |
|
| 148 | -WHERE p.id = count_comment.post_id |
|
| 149 | -SQL, |
|
| 150 | - $postTableName, |
|
| 151 | - $commentTableName |
|
| 152 | - ); |
|
| 153 | - } |
|
| 154 | - } |
|
| 155 | -} |
|
@@ -132,24 +132,3 @@ |
||
| 132 | 132 | switch ($this->getConnection()->getDriver()->getDatabasePlatform()->getName()) { |
| 133 | 133 | case 'postgresql': |
| 134 | 134 | return sprintf(<<<'SQL' |
| 135 | -UPDATE %s SET comments_count = count_comment.total |
|
| 136 | -FROM (SELECT c.post_id, count(*) AS total FROM %s AS c WHERE c.status = 1 GROUP BY c.post_id) count_comment |
|
| 137 | -WHERE %s.id = count_comment.post_id |
|
| 138 | -SQL, |
|
| 139 | - $postTableName, |
|
| 140 | - $commentTableName, |
|
| 141 | - $postTableName |
|
| 142 | - ); |
|
| 143 | - |
|
| 144 | - default: |
|
| 145 | - return sprintf(<<<'SQL' |
|
| 146 | -UPDATE %s p, (SELECT c.post_id, count(*) as total FROM %s as c WHERE c.status = 1 GROUP BY c.post_id) as count_comment |
|
| 147 | -SET p.comments_count = count_comment.total |
|
| 148 | -WHERE p.id = count_comment.post_id |
|
| 149 | -SQL, |
|
| 150 | - $postTableName, |
|
| 151 | - $commentTableName |
|
| 152 | - ); |
|
| 153 | - } |
|
| 154 | - } |
|
| 155 | -} |
|