PHPCleaner   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 1 Features 2
Metric Value
wmc 2
c 4
b 1
f 2
lcom 1
cbo 2
dl 0
loc 35
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A clean() 0 5 1
1
<?php
2
3
namespace Matks\PHPMakeUp;
4
5
use Matks\PHPMakeUp\LineAlignment\LineAlignerInterface;
6
use Matks\PHPMakeUp\UseSorting\UseSortingManager;
7
use Matks\PHPMakeUp\UseSorting\UseSortingManagerInterface;
8
9
/**
10
 * PHPCleaner
11
 */
12
class PHPCleaner
13
{
14
15
    /**
16
     * Lines Aligner tool
17
     *
18
     * @var LineAlignerInterface
19
     */
20
    private $lineAligner;
21
22
    /**
23
     * Use sorting tool
24
     *
25
     * @var UseSortingManagerInterface
26
     */
27
    private $useSortingManager;
28
29
    /**
30
     * @param LineAlignerInterface $lineAligner
31
     */
32
    public function __construct(LineAlignerInterface $lineAligner, UseSortingManagerInterface $useSortingManager)
33
    {
34 1
        $this->lineAligner       = $lineAligner;
35 1
        $this->useSortingManager = $useSortingManager;
36 1
    }
37
38
    /**
39
     * @param string $filepath
40
     */
41
    public function clean($filepath)
42
    {
43 1
        $this->lineAligner->align($filepath);
44 1
        $this->useSortingManager->sort($filepath);
45 1
    }
46
}
47