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

Media   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 20
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A all() 0 2 1
A upload() 0 5 1
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