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 — 3.0 ( 5276e1...94e02b )
by Vermeulen
01:25
created

ComposerLoader::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 9
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A ComposerLoader::getLoader() 0 3 1
1
<?php
2
3
namespace BFW\Core\AppSystems;
4
5
class ComposerLoader extends AbstractSystem
6
{
7
    /**
8
     * @var \Composer\Autoload\ClassLoader $loader Composer auto-loader
9
     */
10
    protected $loader;
11
    
12
    /**
13
     * Define loader property and add all namespaces
14
     */
15
    public function __construct()
16
    {
17
        $this->loader = require(
18
            $this->obtainVendorDir().'autoload.php'
19
        );
20
        
21
        $this->addComposerNamespaces();
22
    }
23
    
24
    /**
25
     * {@inheritdoc}
26
     * 
27
     * @return \Composer\Autoload\ClassLoader
28
     */
29
    public function __invoke()
30
    {
31
        return $this->loader;
32
    }
33
    
34
    /**
35
     * Getter accessor to property loader
36
     * 
37
     * @return \Composer\Autoload\ClassLoader
38
     */
39
    public function getLoader()
40
    {
41
        return $this->loader;
42
    }
43
    
44
    /**
45
     * Return the path to the vendor directory
46
     * 
47
     * @return string
48
     */
49
    protected function obtainVendorDir(): string
50
    {
51
        return \BFW\Application::getInstance()
52
            ->getOptions()
53
            ->getValue('vendorDir')
54
        ;
55
    }
56
57
    /**
58
     * Add namespaces used by a BFW Application to composer
59
     * 
60
     * @return void
61
     */
62
    protected function addComposerNamespaces()
63
    {
64
        $this->loader->addPsr4('Controller\\', CTRL_DIR);
65
        $this->loader->addPsr4('Modules\\', MODULES_DIR);
66
        $this->loader->addPsr4('Modeles\\', MODELES_DIR);
67
    }
68
}
69