Completed
Push — develop ( cba78f...09bcdb )
by Nicolas
12:47
created

Loader::autoLoad()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
3
namespace devtransition\jobbers;
4
5
class Loader
6
{
7
8
    private $_classes = [];
9
    private $_registered = false;
10
11
    public function add($classes)
12
    {
13
        $this->_classes = array_merge($this->_classes, $classes);
14
        if (!$this->_registered) {
15
            $this->register();
16
        }
17
    }
18
19
    public function register()
20
    {
21
        #spl_autoload_register(array($this, 'autoLoad'), true, true);
0 ignored issues
show
Unused Code Comprehensibility introduced by
77% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
22
        $this->_registered = true;
23
    }
24
25
    protected function autoLoad($class)
0 ignored issues
show
Unused Code introduced by
The parameter $class is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
26
    {
27
        #echo "try to load: $class<br \>\n";
28
        #exit;
29
    }
30
31
}