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.

Text::get()   B
last analyzed

Complexity

Conditions 6
Paths 9

Size

Total Lines 25

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 8.8977
c 0
b 0
f 0
cc 6
nc 9
nop 2
1
<?php
2
3
class Text
4
{
5
    private static $texts;
6
7
    public static function get($key, $data = null)
8
    {
9
        // if not $key
10
        if (!$key) {
11
            return null;
12
        }
13
14
        if ($data) {
15
            foreach ($data as $var => $value) {
16
                ${$var} = $value;
17
            }
18
        }
19
20
        // load config file (this is only done once per application lifecycle)
21
        if (!self::$texts) {
22
            self::$texts = require('../application/config/texts.php');
23
        }
24
25
        // check if array key exists
26
        if (!array_key_exists($key, self::$texts)) {
27
            return null;
28
        }
29
30
        return self::$texts[$key];
31
    }
32
}
33