Test Failed
Push — main ( 1d1810...62d3b7 )
by Dylan
02:46
created

Media::all()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 2
rs 10
1
<?php
2
3
namespace Lifeboat\Services;
4
5
use Lifeboat\Exceptions\ApiException;
6
use Lifeboat\Exceptions\OAuthException;
7
use Lifeboat\Models\Media as File;
8
use Lifeboat\Resource\ListResource;
9
10
/**
11
 * Class Media
12
 * @package Lifeboat\Services
13
 */
14
class Media extends ApiService {
15
16
    /**
17
     * @param array $data
18
     * @return File|null
19
     * @throws ApiException
20
     * @throws OAuthException
21
     */
22
    public function upload(array $data): ?File
23
    {
24
        /** @var File|null $create */
25
        $create = $this->_post('api/media/upload', $data);
26
        return $create;
27
    }
28
29
    /**
30
     * @return ListResource
31
     */
32
    public function all(): ListResource {
33
        return new ListResource($this->getClient(), 'api/media/all', [], 50);
34
    }
35
}
36