Completed
Pull Request — master (#10)
by Tomáš
07:32
created

FixerSetFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 25
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A createFromLevelsFixersAndExcludedFixers() 0 9 1
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\Factory;
9
10
use Symfony\CS\Fixer;
11
use Symfony\CS\FixerInterface;
12
use Symplify\PHP7_CodeSniffer\Configuration\ConfigurationResolver;
13
14
final class FixerSetFactory
15
{
16
    /**
17
     * @var FixerResolver
18
     */
19
    private $fixerResolver;
20
21
    public function __construct(FixerResolver $fixerResolver)
22
    {
23
        $this->fixerResolver = $fixerResolver;
24
    }
25
26
    /**
27
     * @return FixerInterface[]
28
     */
29
    public function createFromLevelsFixersAndExcludedFixers(array $fixerLevels, array $fixers, array $excludedFixers) : array
30
    {
31
        $fixersFromLevels = $this->fixerResolver->resolveFixersByLevelAndExcludedFixers($fixerLevels, $excludedFixers);
32
        $standaloneFixers = $this->fixerResolver->resolveFixers($fixers);
33
34
        $allFixers = array_merge($fixersFromLevels, $standaloneFixers);
35
        dump(count($allFixers));
36
        die;
37
    }
38
}
39