Conditions | 2 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
24 | 3 | public function parse(AbstractFile $file) |
|
25 | { |
||
26 | 3 | $collection = new DepositCollection(); |
|
27 | 3 | $fileArray = array_slice($file->toArray(), 5); |
|
28 | |||
29 | array_walk($fileArray, function ($line) use (&$collection) { |
||
30 | 2 | if (!PopularValidator::validate($line)) { |
|
31 | 2 | return; |
|
32 | } |
||
33 | |||
34 | 2 | $collection->push(new Deposit($line[2], $line[0], $line[5], $line[1])); |
|
35 | 3 | }); |
|
36 | |||
37 | 3 | $this->failIfParsedFileIsEmpty($collection); |
|
38 | 2 | $this->cache($collection); |
|
39 | |||
40 | 2 | return $collection; |
|
41 | } |
||
43 |