GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (910)

framework/base/Request.php (1 issue)

Labels
Severity
1
<?php
2
/**
3
 * @link https://www.yiiframework.com/
4
 * @copyright Copyright (c) 2008 Yii Software LLC
5
 * @license https://www.yiiframework.com/license/
6
 */
7
8
namespace yii\base;
9
10
use Yii;
11
12
/**
13
 * Request represents a request that is handled by an [[Application]].
14
 *
15
 * For more details and usage information on Request, see the [guide article on requests](guide:runtime-requests).
16
 *
17
 * @property bool $isConsoleRequest The value indicating whether the current request is made via console.
18
 * @property string $scriptFile Entry script file path (processed w/ realpath()).
19
 *
20
 * @author Qiang Xue <[email protected]>
21
 * @since 2.0
22
 */
23
abstract class Request extends Component
24
{
25
    private $_scriptFile;
26
    private $_isConsoleRequest;
27
28
29
    /**
30
     * Resolves the current request into a route and the associated parameters.
31
     * @return array the first element is the route, and the second is the associated parameters.
32
     */
33
    abstract public function resolve();
34
35
    /**
36
     * Returns a value indicating whether the current request is made via command line.
37
     * @return bool the value indicating whether the current request is made via console
38
     */
39
    public function getIsConsoleRequest()
40
    {
41
        return $this->_isConsoleRequest !== null ? $this->_isConsoleRequest : PHP_SAPI === 'cli';
42
    }
43
44
    /**
45
     * Sets the value indicating whether the current request is made via command line.
46
     * @param bool $value the value indicating whether the current request is made via command line
47
     */
48 448
    public function setIsConsoleRequest($value)
49
    {
50 448
        $this->_isConsoleRequest = $value;
51
    }
52
53
    /**
54
     * Returns entry script file path.
55
     * @return string entry script file path (processed w/ realpath())
56
     * @throws InvalidConfigException if the entry script file path cannot be determined automatically.
57
     */
58 6
    public function getScriptFile()
59
    {
60 6
        if ($this->_scriptFile === null) {
61 6
            if (isset($_SERVER['SCRIPT_FILENAME'])) {
62 6
                $this->setScriptFile($_SERVER['SCRIPT_FILENAME']);
63
            } else {
64
                throw new InvalidConfigException('Unable to determine the entry script file path.');
65
            }
66
        }
67
68 6
        return $this->_scriptFile;
69
    }
70
71
    /**
72
     * Sets the entry script file path.
73
     * The entry script file path can normally be determined based on the `SCRIPT_FILENAME` SERVER variable.
74
     * However, for some server configurations, this may not be correct or feasible.
75
     * This setter is provided so that the entry script file path can be manually specified.
76
     * @param string $value the entry script file path. This can be either a file path or a [path alias](guide:concept-aliases).
77
     * @throws InvalidConfigException if the provided entry script file path is invalid.
78
     */
79 6
    public function setScriptFile($value)
80
    {
81 6
        $scriptFile = realpath(Yii::getAlias($value));
0 ignored issues
show
It seems like Yii::getAlias($value) can also be of type false; however, parameter $path of realpath() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

81
        $scriptFile = realpath(/** @scrutinizer ignore-type */ Yii::getAlias($value));
Loading history...
82 6
        if ($scriptFile !== false && is_file($scriptFile)) {
83 6
            $this->_scriptFile = $scriptFile;
84
        } else {
85
            throw new InvalidConfigException('Unable to determine the entry script file path.');
86
        }
87
    }
88
}
89