UpdateOptions::getDescriptionUrl()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
ccs 0
cts 4
cp 0
rs 9.4285
cc 2
eloc 4
nc 2
nop 0
crap 6
1
<?php
2
/**
3
 * This file is part of the Ssdp project.
4
 *
5
 * @author Daniel Schröder <[email protected]>
6
 */
7
8
namespace GravityMedia\Ssdp\Options;
9
10
use Psr\Http\Message\UriInterface;
11
use Zend\Diactoros\Uri;
12
13
/**
14
 * Update request options class
15
 *
16
 * @package GravityMedia\Ssdp\Request\Options
17
 */
18
class UpdateOptions extends ByebyeOptions
19
{
20
    /**
21
     * Default description URL string (with UPnP description for root device)
22
     */
23
    const DEFAULT_DESCRIPTION_URL_STRING = 'http://127.0.0.1:80/description.xml';
24
25
    /**
26
     * @var UriInterface
27
     */
28
    protected $descriptionUrl;
29
30
    /**
31
     * Get description URL
32
     *
33
     * @return UriInterface
34
     */
35
    public function getDescriptionUrl()
36
    {
37
        if (null === $this->descriptionUrl) {
38
            return new Uri(self::DEFAULT_DESCRIPTION_URL_STRING);
39
        }
40
41
        return $this->descriptionUrl;
42
    }
43
44
    /**
45
     * Set description URL
46
     *
47
     * @param UriInterface $descriptionUrl
48
     *
49
     * @return $this
50
     */
51
    public function setDescriptionUrl(UriInterface $descriptionUrl)
52
    {
53
        $this->descriptionUrl = $descriptionUrl;
54
        return $this;
55
    }
56
}
57