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

PhpCsFixerFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 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;
9
10
use Symfony\CS\Fixer;
11
12
final class PhpCsFixerFactory
13
{
14
    /**
15
     * @var EnabledFixerResolver
16
     */
17
    private $enabledFixerResolver;
18
19
    public function __construct(EnabledFixerResolver $enabledFixerResolver)
20
    {
21
        $this->enabledFixerResolver = $enabledFixerResolver;
22
    }
23
    
24
    public function create() : Fixer
25
    {
26
        $phpCsFixer = new Fixer();
27
        $phpCsFixer->registerCustomFixers(
28
            $this->enabledFixerResolver->getEnabledFixers()
29
        );
30
31
        return $phpCsFixer;
32
    }
33
}
34