Total Complexity | 8 |
Total Lines | 76 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
11 | class FileList |
||
12 | { |
||
13 | /** |
||
14 | * @var array |
||
15 | */ |
||
16 | private $templates = []; |
||
17 | |||
18 | /** |
||
19 | * @var array |
||
20 | */ |
||
21 | private $phpFileList = []; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | private $xmlFileList = []; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | private $composerFile = ''; |
||
32 | |||
33 | /** |
||
34 | * @param SplFileInfo $file |
||
35 | */ |
||
36 | public function addEntry(SplFileInfo $file) |
||
37 | { |
||
38 | switch ($file->getExtension()) { |
||
39 | case 'php': |
||
40 | $this->phpFileList[] = $file; |
||
41 | break; |
||
42 | |||
43 | case 'json': |
||
44 | $this->composerFile = $file; |
||
45 | break; |
||
46 | |||
47 | case 'xml': |
||
48 | $this->xmlFileList[] = $file; |
||
49 | break; |
||
50 | |||
51 | default: |
||
52 | $this->templates[] = $file; |
||
53 | break; |
||
54 | } |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * @return SplFileInfo[] | array |
||
59 | */ |
||
60 | public function getPhpFileList(): array |
||
61 | { |
||
62 | return $this->phpFileList; |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * @return string |
||
67 | */ |
||
68 | public function getComposerFile(): string |
||
69 | { |
||
70 | return $this->composerFile; |
||
71 | } |
||
72 | |||
73 | /** |
||
74 | * @return SplFileInfo[] | array |
||
75 | */ |
||
76 | public function getTemplates(): array |
||
77 | { |
||
78 | return $this->templates; |
||
79 | } |
||
80 | |||
81 | /** |
||
82 | * @return SplFileInfo[] | array |
||
83 | */ |
||
84 | public function getXmlFileList(): array |
||
87 | } |
||
88 | } |
||
89 |