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

FixerFileSystem::findAllFixers()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
ccs 7
cts 7
cp 1
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
crap 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\FileSystem;
9
10
use ReflectionClass;
11
use Symfony\Component\Finder\Finder;
12
use Symfony\CS\Fixer;
13
use Symplify\MultiCodingStandard\Contract\PhpCsFixer\FileSystem\FixerFileSystemInterface;
14
15
final class FixerFileSystem implements FixerFileSystemInterface
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20 1
    public function findAllFixers()
21
    {
22 1
        $phpCsFixerReflection = new ReflectionClass(Fixer::class);
23 1
        $directoryWithFixers = dirname($phpCsFixerReflection->getFileName()) . '/Fixer';
24
25 1
        $finder = Finder::create()
26 1
            ->files()
27 1
            ->in($directoryWithFixers);
28
29 1
        return iterator_to_array($finder);
30
    }
31
}
32