GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Input   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 55
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A fromUrl() 0 7 1
A getUrl() 0 4 1
A setUrl() 0 6 1
A format() 0 10 1
1
<?php
2
3
namespace Fab\Clarifai;
4
5
class Input
6
{
7
    /**
8
     * The image URL.
9
     * @var string
10
     */
11
    protected $url;
12
13
    /**
14
     * Instantiate a new input from an url.
15
     *
16
     * @param  string $url The image URL.
17
     * @return Input
18
     */
19 5
    public static function fromUrl($url)
20
    {
21 5
        $input = new static();
22 5
        $input->setUrl($url);
23
24 5
        return $input;
25
    }
26
27
    /**
28
     * Get the image URL.
29
     *
30
     * @return string
31
     */
32 1
    public function getUrl()
33
    {
34 1
        return $this->url;
35
    }
36
37 5
    public function setUrl($url)
38
    {
39 5
        $this->url = $url;
40
41 5
        return $this;
42
    }
43
44
    /**
45
     * Format the input for querying the Clarifai API.
46
     *
47
     * @return array
48
     */
49 4
    public function format()
50
    {
51
        return [
52
            'data' => [
53
                'image' => [
54 4
                    'url' => $this->url,
55
                ]
56
            ]
57
        ];
58
    }
59
}
60