Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
51 | protected function addPhotoFields(array& $fields) |
||
52 | { |
||
53 | $count = count($this->photos); |
||
54 | if (!$count) { |
||
55 | return; |
||
56 | } |
||
57 | |||
58 | $index = 0; |
||
59 | foreach ($this->photos as $photo) { |
||
60 | if (!is_readable($photo)) { |
||
61 | throw new Exception("Photo file {$photo} is not readable"); |
||
62 | } |
||
63 | |||
64 | $fields[] = (new Field(AuctionFids::FID_PHOTO + $index, file_get_contents($photo), Field::VALUE_IMAGE))->toArray(); |
||
65 | $index++; |
||
66 | } |
||
67 | } |
||
68 | |||
77 |