Completed
Push — master ( fe5f39...abd96b )
by Tomáš
05:18 queued 02:13
created

FixerFactory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 18
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createFixersFromFiles() 0 11 3
1
<?php
2
3
/*
4
 * This file is part of Symplify
5
 * Copyright (c) 2016 Tomas Votruba (http://tomasvotruba.cz).
6
 */
7
8
namespace Symplify\MultiCodingStandard\PhpCsFixer\Fixer;
9
10
use Symfony\CS\FixerInterface;
11
12
final class FixerFactory
13
{
14
    /**
15
     * @param string[] $files
16
     * @return FixerInterface[]
17
     */
18 1
    public function createFixersFromFiles(array $files)
19
    {
20 1
        $fixers = [];
21 1
        foreach ($files as $file) {
22 1
            $relativeNamespace = $file->getRelativePath();
0 ignored issues
show
Bug introduced by
The method getRelativePath cannot be called on $file (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
23 1
            $class = 'Symfony\\CS\\Fixer\\' . ($relativeNamespace ? $relativeNamespace . '\\' : '') . $file->getBasename('.php');
0 ignored issues
show
Bug introduced by
The method getBasename cannot be called on $file (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
24 1
            $fixers[] = new $class;
25
        }
26
27 1
        return $fixers;
28
    }
29
}
30