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/rest/OptionsAction.php (3 issues)

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\rest;
9
10
use Yii;
11
12
/**
13
 * OptionsAction responds to the OPTIONS request by sending back an `Allow` header.
14
 *
15
 * For more details and usage information on OptionsAction, see the [guide article on rest controllers](guide:rest-controllers).
16
 *
17
 * @author Qiang Xue <[email protected]>
18
 * @since 2.0
19
 */
20
class OptionsAction extends \yii\base\Action
21
{
22
    /**
23
     * @var array the HTTP verbs that are supported by the collection URL
24
     */
25
    public $collectionOptions = ['GET', 'POST', 'HEAD', 'OPTIONS'];
26
    /**
27
     * @var array the HTTP verbs that are supported by the resource URL
28
     */
29
    public $resourceOptions = ['GET', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS'];
30
31
32
    /**
33
     * Responds to the OPTIONS request.
34
     * @param string|null $id
35
     */
36
    public function run($id = null)
37
    {
38
        if (Yii::$app->getRequest()->getMethod() !== 'OPTIONS') {
0 ignored issues
show
The method getMethod() does not exist on yii\console\Request. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

38
        if (Yii::$app->getRequest()->/** @scrutinizer ignore-call */ getMethod() !== 'OPTIONS') {
Loading history...
39
            Yii::$app->getResponse()->setStatusCode(405);
0 ignored issues
show
The method setStatusCode() does not exist on yii\console\Response. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

39
            Yii::$app->getResponse()->/** @scrutinizer ignore-call */ setStatusCode(405);
Loading history...
40
        }
41
        $options = $id === null ? $this->collectionOptions : $this->resourceOptions;
42
        $headers = Yii::$app->getResponse()->getHeaders();
0 ignored issues
show
The method getHeaders() does not exist on yii\console\Response. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

42
        $headers = Yii::$app->getResponse()->/** @scrutinizer ignore-call */ getHeaders();
Loading history...
43
        $headers->set('Allow', implode(', ', $options));
44
        $headers->set('Access-Control-Allow-Methods', implode(', ', $options));
45
    }
46
}
47