PhotoResponse   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 1
Metric Value
wmc 2
c 4
b 0
f 1
lcom 0
cbo 2
dl 0
loc 25
ccs 4
cts 4
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getUrl() 0 4 1
A __toString() 0 4 1
1
<?php
2
3
namespace Bangpound\oEmbed\Response;
4
5
/**
6
 * Class PhotoResponse.
7
 */
8
class PhotoResponse extends Response
9
{
10
    use DimensionTrait;
11
12
    /**
13
     * @var string
14
     */
15
    protected $url;
16
17
    /**
18
     * @return string
19
     */
20 2
    public function getUrl()
21
    {
22 2
        return $this->url;
23
    }
24
25
    /**
26
     * @return string
27
     */
28 2
    public function __toString()
29
    {
30 2
        return sprintf('<img src="%s" width="%u" height="%u" alt="%s" />', filter_var($this->getUrl(), FILTER_SANITIZE_FULL_SPECIAL_CHARS), $this->getWidth(), $this->getHeight(), $this->getTitle());
31
    }
32
}
33