Completed
Push — 3.x ( fe4009...05c76d )
by Grégoire
03:50
created

MonthlyPostArchiveAction::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 3
1
<?php
2
3
/*
4
 * This file is part of the Sonata Project package.
5
 *
6
 * (c) Thomas Rabaix <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sonata\NewsBundle\Action;
13
14
use Symfony\Component\HttpFoundation\Request;
15
use Symfony\Component\HttpFoundation\Response;
16
17
final class MonthlyPostArchiveAction extends AbstractPostArchiveAction
18
{
19
    /**
20
     * @param string $year
21
     * @param string $month
22
     *
23
     * @return Response
24
     */
25
    public function __invoke(Request $request, $year, $month)
26
    {
27
        return $this->renderArchive($request, [
28
            'date' => $this->getPostManager()->getPublicationDateQueryParts(
29
                sprintf('%d-%d-%d', $year, $month, 1),
30
                'month'
31
            ),
32
        ], []);
33
    }
34
}
35