Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
39 | public function uploadMedias(MediaUploadMessage $message): array |
||
40 | { |
||
41 | $message->initBuilder(); |
||
42 | |||
43 | $path = sprintf('sites/%d/uploads/media', $message->getSiteId()); |
||
44 | $body = $message->build(); |
||
45 | $headers = $message->buildHeaders(); |
||
46 | |||
47 | $response = $this->getClient()->sendRequest('POST', $path, $body, $headers); |
||
48 | |||
49 | /** @var Media[] $model */ |
||
50 | $model = $this->getModelFactory()->createMany(Media::class, $response); |
||
|
|||
51 | |||
52 | return $model; |
||
53 | } |
||
54 | } |
||
55 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.