Xkcd   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getUrl() 0 4 1
A getImageUrl() 0 4 1
A getAlternateText() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Nastoletni\Code\Domain;
6
7
class Xkcd
8
{
9
    /**
10
     * @var string
11
     */
12
    private $url;
13
14
    /**
15
     * @var string
16
     */
17
    private $imageUrl;
18
19
    /**
20
     * @var string
21
     */
22
    private $alternateText;
23
24
    /**
25
     * Xkcd constructor.
26
     *
27
     * @param string $url
28
     * @param string $imageUrl
29
     * @param string $alternateText
30
     */
31 1
    public function __construct(string $url, string $imageUrl, string $alternateText)
32
    {
33 1
        $this->url = $url;
34 1
        $this->imageUrl = $imageUrl;
35 1
        $this->alternateText = $alternateText;
36 1
    }
37
38
    /**
39
     * @return string
40
     */
41 1
    public function getUrl(): string
42
    {
43 1
        return $this->url;
44
    }
45
46
    /**
47
     * @return string
48
     */
49 1
    public function getImageUrl(): string
50
    {
51 1
        return $this->imageUrl;
52
    }
53
54
    /**
55
     * @return string
56
     */
57 1
    public function getAlternateText(): string
58
    {
59 1
        return $this->alternateText;
60
    }
61
}
62