Total Complexity | 4 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | class UserProfilePhotos extends Entity |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * Requested profile pictures (in up to 4 sizes each) |
||
20 | * |
||
21 | * This method overrides the default getPhotos method and returns a nice array |
||
22 | * |
||
23 | * @return PhotoSize[][] |
||
24 | */ |
||
25 | public function getPhotos(): array |
||
26 | { |
||
27 | $all_photos = []; |
||
28 | |||
29 | if ($these_photos = $this->getProperty('photos')) { |
||
30 | foreach ($these_photos as $photos) { |
||
31 | $all_photos[] = array_map(function ($photo) { |
||
32 | return new PhotoSize($photo); |
||
33 | }, $photos); |
||
34 | } |
||
35 | } |
||
36 | |||
37 | return $all_photos; |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * {@inheritdoc} |
||
42 | */ |
||
43 | protected function subEntities(): array |
||
47 | ]; |
||
48 | } |
||
51 |