RedirectController::redirectAction()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
namespace MOC\Redirects\Controller;
3
4
use Neos\Flow\Annotations as Flow;
5
use Neos\Flow\Mvc\Controller\ActionController;
6
use Neos\Neos\Service\LinkingService;
7
use Neos\ContentRepository\Domain\Model\Node;
8
9
class RedirectController extends ActionController
10
{
11
12
    /**
13
     * @Flow\Inject
14
     * @var LinkingService
15
     */
16
    protected $linkingService;
17
18
    /**
19
     * @param Node $node
20
     * @return void
21
     *
22
     * @Flow\IgnoreValidation("node")
23
     */
24
    public function redirectAction(Node $node)
25
    {
26
        $this->redirectToUri(
27
            $this->linkingService->createNodeUri($this->controllerContext, $node, null, null, true, [], '', true),
28
            0,
29
            301
30
        );
31
    }
32
33
}
34