Conditions | 3 |
Paths | 4 |
Total Lines | 30 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
62 | public function warmUp($cacheDir) |
||
63 | { |
||
64 | $files = $this |
||
65 | ->finder |
||
66 | ->in($this->vendor) |
||
67 | ->files() |
||
68 | ->name($this->documentation) |
||
69 | ; |
||
70 | |||
71 | $definitions = []; |
||
72 | |||
73 | foreach ($files as $file) { |
||
74 | $definitions[] = ['readme' => $file->getRealpath()]; |
||
75 | } |
||
76 | |||
77 | foreach ($this->filters as $filter) { |
||
78 | $definitions = $filter($definitions); |
||
79 | } |
||
80 | |||
81 | $packages = array_map(function ($e) { |
||
82 | return $e['package']; |
||
83 | }, $definitions); |
||
84 | $definitions = array_combine($packages, $definitions); |
||
85 | |||
86 | ksort($definitions); |
||
87 | |||
88 | $export = json_encode($definitions, JSON_PRETTY_PRINT); |
||
89 | |||
90 | file_put_contents($this->cache, $export); |
||
91 | } |
||
92 | |||
101 |