Completed
Pull Request — master (#10)
by Tomáš
07: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 0
CRAP Score 2

Importance

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