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 ( 3143fd...3ca7c0 )
by Alireza
11s
created

AppHelper   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 3
Bugs 2 Features 1
Metric Value
wmc 7
c 3
b 2
f 1
lcom 0
cbo 1
dl 0
loc 34
rs 10

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\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