DownloadHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 7 2
1
<?php
2
3
namespace Ijeffro\Laralocker\LearningLocker\Downloads;
4
5
use Ijeffro\Laralocker\LearningLocker\API\APIHandler;
6
7
class DownloadHandler extends APIHandler implements DownloadInterface {
8
9
    private $download = '/download';
10
    private $api = '/api';
11
    private $v1 = '/v1';
0 ignored issues
show
introduced by
The private property $v1 is not used, and could be removed.
Loading history...
12
    private $v2 = '/v2';
13
14
    protected $headers = [
15
      'content-type' => 'application/json'
16
    ];
17
18
    /**
19
     * Learning Locker: Request Organisation Details
20
     *
21
     * @return  $response
0 ignored issues
show
Documentation Bug introduced by
The doc comment $response at position 0 could not be parsed: Unknown type name '$response' at position 0 in $response.
Loading history...
22
     */
23
    public function get() {
24
        try {
25
            $url = $this->url . $this->api . $this->v2 . $this->download;
26
            $response = $this->request($url);
27
            return $response;
28
        } catch (Exception $e) {
0 ignored issues
show
Bug introduced by
The type Ijeffro\Laralocker\Learn...ker\Downloads\Exception was not found. Did you mean Exception? If so, make sure to prefix the type with \.
Loading history...
29
            return $e;
30
        }
31
    }
32
33
}
34