Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
62 | protected function addPhotoFields(array& $fields) |
||
63 | { |
||
64 | $count = count($this->photos); |
||
65 | if (!$count) { |
||
66 | return; |
||
67 | } |
||
68 | |||
69 | $index = 0; |
||
70 | foreach ($this->photos as $photo) { |
||
71 | if (!is_readable($photo)) { |
||
72 | throw new Exception("Photo file {$photo} is not readable"); |
||
73 | } |
||
74 | |||
75 | $fields[] = (new Field(AuctionFids::FID_PHOTO + $index, file_get_contents($photo), Field::VALUE_IMAGE))->toArray(); |
||
76 | $index++; |
||
77 | } |
||
78 | } |
||
79 | |||
81 |