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.

AppHelper   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 0
dl 0
loc 39
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getNameSpace() 0 3 1
A validName() 0 3 1
A access() 0 7 2
A getModel() 0 14 3
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\DetectsApplicationNamespace;
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
    /**
30
     * For the given entity name, the the corresponding Model's class
31
     * @param string $entity
32
     * @return string
33
     */
34
    public function getModel($entity) {
35
        if ( \Links::isMain($entity) ) {
36
            $modelClass = 'Serverfireteam\\Panel\\'.$entity;
37
        } else {
38
            if (!empty(\Config::get('panel.modelPath'))) {
39
                $modelClass = $this->getNameSpace() . \Config::get('panel.modelPath') . '\\' . $entity;
40
            }
41
            else {
42
                $modelClass = $this->getNameSpace() . $entity;
43
            }
44
45
        }
46
        return $modelClass;
47
    }
48
}
49