CommandsLoader   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
eloc 8
dl 0
loc 17
c 0
b 0
f 0
ccs 0
cts 11
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 15 4
1
<?php namespace Comodojo\Dispatcher\Components;
2
3
use \Comodojo\Foundation\Base\AbstractYamlLoader;
4
use \Exception;
5
6
/**
7
 * @package     Comodojo Dispatcher
8
 * @author      Marco Giovinazzi <[email protected]>
9
 * @author      Marco Castiello <[email protected]>
10
 * @license     MIT
11
 *
12
 * LICENSE:
13
 *
14
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
 * THE SOFTWARE.
21
 */
22
23
class CommandsLoader extends AbstractYamlLoader {
24
25
    public static function load($file, array $attributes = []) {
0 ignored issues
show
Unused Code introduced by
The parameter $attributes is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

25
    public static function load($file, /** @scrutinizer ignore-unused */ array $attributes = []) {

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

Loading history...
26
27
        $config = static::importData($file);
28
29
        $classes = [];
30
31
        foreach ($config as $package) {
32
            foreach ($package as $command) {
33
                if ( $command['scope'] === 'dispatcher') {
34
                    $classes[] = $command['class'];
35
                }
36
            }
37
        }
38
39
        return $classes;
40
41
    }
42
43
}
44