Completed
Pull Request — master (#10)
by Tomáš
31:42
created

ConfigurationResolverFactory::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
ccs 0
cts 4
cp 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
crap 2
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\Configuration;
9
10
use Symfony\CS\ConfigurationResolver;
11
use Symfony\CS\Fixer;
12
use Symfony\CS\FixerInterface;
13
14
final class ConfigurationResolverFactory
15
{
16
    public function create() : ConfigurationResolver
17
    {
18
        $configurationResolver = new ConfigurationResolver();
19
        $configurationResolver->setAllFixers($this->getAllFixers());
20
        return $configurationResolver;
21
    }
22
23
    /**
24
     * @return FixerInterface[]
25
     */
26
    private function getAllFixers() : array
27
    {
28
        $fixer = new Fixer();
29
        $fixer->registerBuiltInFixers();
30
        return $fixer->getFixers();
31
    }
32
}
33