1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* PHP version 7.1 |
4
|
|
|
* |
5
|
|
|
* This source file is subject to the license that is bundled with this package in the file LICENSE. |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
namespace PhUml\Console\Commands; |
9
|
|
|
|
10
|
|
|
use Webmozart\Assert\Assert; |
|
|
|
|
11
|
|
|
|
12
|
|
|
class StatisticsInput |
13
|
|
|
{ |
14
|
|
|
/** @var string */ |
15
|
|
|
private $directory; |
16
|
|
|
|
17
|
|
|
/** @var string */ |
18
|
|
|
private $outputFile; |
19
|
|
|
|
20
|
|
|
/** @var bool */ |
21
|
|
|
private $recursive; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @param string[] $arguments |
25
|
|
|
* @param string[] $options |
26
|
|
|
*/ |
27
|
|
|
public function __construct(array $arguments, array $options) |
28
|
|
|
{ |
29
|
|
|
$this->setDirectory($arguments); |
30
|
|
|
$this->setOutputFile($arguments); |
31
|
|
|
$this->setRecursive($options); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
public function directory(): string |
35
|
|
|
{ |
36
|
|
|
return $this->directory; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
public function outputFile(): string |
40
|
|
|
{ |
41
|
|
|
return $this->outputFile; |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
public function recursive(): bool |
45
|
|
|
{ |
46
|
|
|
return $this->recursive; |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** @param string[] $arguments */ |
50
|
|
|
private function setDirectory(array $arguments): void |
51
|
|
|
{ |
52
|
|
|
Assert::stringNotEmpty( |
53
|
|
|
$arguments['directory'] ?? '', |
54
|
|
|
'The directory with the code to be scanned cannot be empty' |
55
|
|
|
); |
56
|
|
|
$this->directory = $arguments['directory']; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** @param string[] $arguments */ |
60
|
|
|
private function setOutputFile(array $arguments): void |
61
|
|
|
{ |
62
|
|
|
Assert::stringNotEmpty( |
63
|
|
|
$arguments['output'] ?? '', |
64
|
|
|
'The output file cannot be empty' |
65
|
|
|
); |
66
|
|
|
$this->outputFile = $arguments['output']; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
/** @param string[] $options */ |
70
|
|
|
private function setRecursive(array $options): void |
71
|
|
|
{ |
72
|
|
|
$this->recursive = isset($options['recursive']) && (bool)$options['recursive']; |
73
|
|
|
} |
74
|
|
|
} |
75
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths