Passed
Push — master ( 14805b...8eb528 )
by
unknown
14:18
created

ReferringRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the TYPO3 CMS project.
5
 *
6
 * It is free software; you can redistribute it and/or modify it under
7
 * the terms of the GNU General Public License, either version 2
8
 * of the License, or any later version.
9
 *
10
 * For the full copyright and license information, please read the
11
 * LICENSE.txt file that was distributed with this source code.
12
 *
13
 * The TYPO3 project - inspiring people to share!
14
 */
15
16
namespace TYPO3\CMS\Extbase\Mvc\Web;
17
18
use TYPO3\CMS\Extbase\Mvc\Request;
19
20
/**
21
 * Represents a referring web request.
22
 *
23
 * @deprecated since v11, will be removed in v12. Create a ForwardResponse instead, see ActionController->forwardToReferringRequest()
24
 */
25
class ReferringRequest extends Request
26
{
27
    /**
28
     * @param string $controllerClassName
29
     */
30
    public function __construct(string $controllerClassName = '')
31
    {
32
        // @todo: Move to parent::__construct() in case Request is deprecated in v11, too, otherwise drop this todo.
33
        trigger_error(__CLASS__ . ' will be removed in TYPO3 v12, use ForwardResponse instead, see ActionController->forwardToReferringRequest().', E_USER_DEPRECATED);
34
        parent::__construct($controllerClassName);
35
    }
36
37
    /**
38
     * Sets the value of the specified argument
39
     *
40
     * @param string $argumentName Name of the argument to set
41
     * @param mixed $value The new value
42
     */
43
    public function setArgument($argumentName, $value)
44
    {
45
        parent::setArgument($argumentName, $value);
46
47
        switch ($argumentName) {
48
            case '@extension':
49
                $this->setControllerExtensionName($value);
50
                break;
51
            case '@controller':
52
                $this->setControllerName($value);
53
                break;
54
            case '@action':
55
                $this->setControllerActionName($value);
56
                break;
57
            case '@format':
58
                $this->setFormat($value);
59
                break;
60
        }
61
    }
62
}
63