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