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
Pull Request — master (#276)
by
unknown
08:43
created

AppHelper::access()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 7
rs 9.4285
cc 2
eloc 5
nc 2
nop 4
1
<?php
2
namespace Serverfireteam\Panel\libs;
3
4
/* 
5
 * To change this license header, choose License Headers in Project Properties.
6
 * To change this template file, choose Tools | Templates
7
 * and open the template in the editor.
8
 */
9
10
class AppHelper {
11
    use \Illuminate\Console\AppNamespaceDetectorTrait;
12
13
    public function getNameSpace(){
14
        return $this->getAppNamespace();
15
    }
16
17
    public static function validName($name) {
18
	   return strpos($name, '.') !== 0;
19
    }
20
21
    public static function access($attr, $path, $data, $volume) {
22
    	if (strpos(basename($path), '.') === 0) {
23
    	        return !($attr == 'read');
24
    	} else {
25
    	        return null;
26
    	}
27
    }
28
29
    public function getModel($entity) {
30
        if ( in_array($entity, \Serverfireteam\Panel\Link::getMainUrls()) ) {
31
            $modelClass = 'Serverfireteam\\Panel\\'.$entity;
32
        } else {
33
            if (!empty(\Config::get('panel.modelPath'))) {
34
                $modelClass = $this->getNameSpace() . \Config::get('panel.modelPath') . '\\' . $entity;
35
            }
36
            else {
37
                $modelClass = $this->getNameSpace() . $entity;
38
            }
39
            
40
        }
41
        return $modelClass;
42
    }
43
}
44