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
Branch master (4c99ce)
by Christian
04:26 queued 02:19
created

Text::get()   B

Complexity

Conditions 6
Paths 9

Size

Total Lines 23
Code Lines 11

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 23
rs 8.5907
cc 6
eloc 11
nc 9
nop 2
1
<?php
2
3
class Text
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
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
	    if ($data) {
14
		foreach ($data as $var => $value) {
15
		${$var} = $value;
16
		} 
17
		}
18
	    // load config file (this is only done once per application lifecycle)
19
        if (!self::$texts) {
20
            self::$texts = require('../application/config/texts.php');
21
        }
22
23
	    // check if array key exists
24
	    if (!array_key_exists($key, self::$texts)) {
25
		    return null;
26
	    }
27
28
        return self::$texts[$key];
29
    }
30
31
}
32