Completed
Push — master ( 0ecd6b...9f36b3 )
by Tim
03:56
created

IndexViewHelper::initializeArguments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
/**
3
 * Link to the index.
4
 */
5
namespace HDNET\Calendarize\ViewHelpers\Link;
6
7
use HDNET\Calendarize\Domain\Model\Index;
8
9
/**
10
 * Link to the index.
11
 */
12
class IndexViewHelper extends AbstractLinkViewHelper
13
{
14
    /**
15
     * Init arguments
16
     */
17
    public function initializeArguments()
18
    {
19
        parent::initializeArguments();
20
        $this->registerArgument('index', Index::class, '', true);
21
        $this->registerArgument('pageUid', 'int', '', false, 0);
22
        $this->registerArgument('absolute', 'bool', '', false, false);
23
    }
24
25
    /**
26
     * Render the link to the given index.
27
     *
28
     * @return string
29
     */
30
    public function render()
31
    {
32
        $additionalParams = [
33
            'tx_calendarize_calendar' => [
34
                'index' => $this->arguments['index']->getUid(),
35
            ],
36
        ];
37
38
        return parent::renderLink($this->getPageUid($this->arguments['pageUid'], 'detailPid'), $additionalParams, (bool) $this->arguments['absolute']);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (renderLink() instead of render()). Are you sure this is correct? If so, you might want to change this to $this->renderLink().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
39
    }
40
}
41