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.
Passed
Push — 3.0 ( 700313...58bd2d )
by Vermeulen
01:18
created

ComposerLoader::obtainVendorDir()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
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('Modules\\', MODULES_ENABLED_DIR);
0 ignored issues
show
Bug introduced by
The constant BFW\Core\AppSystems\MODULES_ENABLED_DIR was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
65
    }
66
}
67