Completed
Push — feature/middleware ( 864c18 )
by Romain
03:21
created

PreviousLinkViewHelper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 38
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A initializeArguments() 0 7 1
A render() 0 22 1
1
<?php
2
/*
3
 * 2017 Romain CANON <[email protected]>
4
 *
5
 * This file is part of the TYPO3 FormZ project.
6
 * It is free software; you can redistribute it and/or modify it
7
 * under the terms of the GNU General Public License, either
8
 * version 3 of the License, or any later version.
9
 *
10
 * For the full copyright and license information, see:
11
 * http://www.gnu.org/licenses/gpl-3.0.html
12
 */
13
14
namespace Romm\Formz\ViewHelpers;
15
16
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
17
18
class PreviousLinkViewHelper extends AbstractTagBasedViewHelper
19
{
20
    /**
21
     * @var string
22
     */
23
    protected $tagName = 'a';
24
25
    public function initializeArguments()
26
    {
27
        $this->registerTagAttribute('name', 'string', 'Specifies the name of an anchor');
28
        $this->registerTagAttribute('rel', 'string', 'Specifies the relationship between the current document and the linked document');
29
        $this->registerTagAttribute('rev', 'string', 'Specifies the relationship between the linked document and the current document');
30
        $this->registerTagAttribute('target', 'string', 'Specifies where to open the linked document');
31
    }
32
33
    public function render()
34
    {
35
        $uriBuilder = $this->controllerContext->getUriBuilder();
36
        $uri = $uriBuilder
37
            ->reset()
38
            ->setTargetPageUid($pageUid)
0 ignored issues
show
Bug introduced by
The variable $pageUid does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
39
            ->setTargetPageType($pageType)
0 ignored issues
show
Bug introduced by
The variable $pageType does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
40
            ->setUseCacheHash(true)
41
            ->setSection($section)
0 ignored issues
show
Bug introduced by
The variable $section does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
42
            ->setFormat($format)
0 ignored issues
show
Bug introduced by
The variable $format does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
43
            ->setLinkAccessRestrictedPages($linkAccessRestrictedPages)
0 ignored issues
show
Bug introduced by
The variable $linkAccessRestrictedPages does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
44
            ->setArguments($additionalParams)
0 ignored issues
show
Bug introduced by
The variable $additionalParams does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
45
            ->setCreateAbsoluteUri($absolute)
0 ignored issues
show
Bug introduced by
The variable $absolute does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
46
            ->setAddQueryString($addQueryString)
0 ignored issues
show
Bug introduced by
The variable $addQueryString does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
47
            ->setArgumentsToBeExcludedFromQueryString($argumentsToBeExcludedFromQueryString)
0 ignored issues
show
Bug introduced by
The variable $argumentsToBeExcludedFromQueryString does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
48
            ->setAddQueryStringMethod($addQueryStringMethod)
0 ignored issues
show
Bug introduced by
The variable $addQueryStringMethod does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
49
            ->uriFor($action, $arguments, $controller, $extensionName, $pluginName);
0 ignored issues
show
Bug introduced by
The variable $action does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
Bug introduced by
The variable $arguments does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
Bug introduced by
The variable $controller does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
Bug introduced by
The variable $extensionName does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
Bug introduced by
The variable $pluginName does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
50
        $this->tag->addAttribute('href', $uri);
51
        $this->tag->setContent($this->renderChildren());
52
        $this->tag->forceClosingTag(true);
53
        return $this->tag->render();
54
    }
55
}
56