Completed
Pull Request — master (#10)
by Tomáš
24:14
created

PhpCsFixerFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
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;
9
10
use Symfony\CS\Fixer;
11
use Symfony\CS\FixerInterface;
12
13
final class PhpCsFixerFactory
14
{
15
    /**
16
     * @var EnabledFixerResolver
17
     */
18
    private $enabledFixerResolver;
19
20
    public function __construct(EnabledFixerResolver $enabledFixerResolver)
21
    {
22
        $this->enabledFixerResolver = $enabledFixerResolver;
23
    }
24
    
25
    /**
26
     * @return Fixer
27
     */
28
    public function create()
29
    {
30
        $phpCsFixer = new Fixer();
31
        $phpCsFixer->registerCustomFixers(
32
            $this->enabledFixerResolver->getEnabledFixers()
33
        );
34
35
        return $phpCsFixer;
36
    }
37
}
38