Completed
Push — master ( 4cc4cf...1e6e7e )
by Tim
13:02 queued 10s
created

VoteViewHelper::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types = 1);
4
/**
5
 * VoteViewHelper.php.
6
 */
7
8
namespace HDNET\Faq\ViewHelpers\Widget;
9
10
use HDNET\Faq\ViewHelpers\Widget\Controller\VoteController;
11
use TYPO3\CMS\Extbase\Mvc\ResponseInterface;
12
use TYPO3\CMS\Fluid\Core\Widget\Exception\MissingControllerException;
13
use TYPO3Fluid\Fluid\Core\ViewHelper\Exception;
14
15
/**
16
 * VoteViewHelper.
17
 */
18
class VoteViewHelper extends AbstractWidgetViewHelper
19
{
20
    /**
21
     * AJAX Widget?
22
     *
23
     * @var bool
24
     */
25
    protected $ajaxWidget = true;
26
27
    /**
28
     * Controller.
29
     *
30
     * @var VoteController
31
     */
32
    protected $controller;
33
34
    public function __construct(VoteController $voteController)
35
    {
36
        $this->controller = $voteController;
37
    }
38
39
    /**
40
     * Initialize arguments.
41
     *
42
     * @throws Exception
43
     */
44
    public function initializeArguments()
45
    {
46
        parent::initializeArguments();
47
        $this->registerArgument('question', 'int', '', true);
48
        $this->registerArgument('counters', 'array', '', true);
49
    }
50
51
    /**
52
     * Render.
53
     *
54
     * @throws MissingControllerException
55
     *
56
     * @return ResponseInterface
57
     */
58
    public function render()
59
    {
60
        return $this->initiateSubRequest();
61
    }
62
}
63