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.
Completed
Push — master ( ecd2dc...aafa57 )
by Robert
18:49
created

ViewFinderTrait::getViewNames()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 4
nc 2
nop 2
crap 3
1
<?php
2
/**
3
 * @link http://www.yiiframework.com/
4
 * @copyright Copyright (c) 2008 Yii Software LLC
5
 * @license http://www.yiiframework.com/license/
6
 */
7
8
namespace yii\db;
9
10
/**
11
 * ViewFinderTrait implements the method getViewNames for finding views in a database.
12
 *
13
 * @author Qiang Xue <[email protected]>
14
 * @author Bob Olde Hampsink <[email protected]>
15
 * @since 2.0.12
16
 */
17
trait ViewFinderTrait
18
{
19
    /**
20
     * @var array list of ALL view names in the database
21
     */
22
    private $_viewNames = [];
23
24
    /**
25
     * Returns all views names in the database.
26
     * @param string $schema the schema of the views. Defaults to empty string, meaning the current or default schema.
27
     * @return array all views names in the database. The names have NO schema name prefix.
28
     */
29
    abstract protected function findViewNames($schema = '');
30
31
    /**
32
     * Returns all view names in the database.
33
     * @param string $schema the schema of the views. Defaults to empty string, meaning the current or default schema name.
34
     * If not empty, the returned view names will be prefixed with the schema name.
35
     * @param bool $refresh whether to fetch the latest available view names. If this is false,
36
     * view names fetched previously (if available) will be returned.
37
     * @return string[] all view names in the database.
38
     */
39 2
    public function getViewNames($schema = '', $refresh = false)
40
    {
41 2
        if (!isset($this->_viewNames[$schema]) || $refresh) {
42 2
            $this->_viewNames[$schema] = $this->findViewNames($schema);
43 2
        }
44
45 2
        return $this->_viewNames[$schema];
46
    }
47
}
48