Completed
Push — master ( b035c8...ddcf44 )
by Paweł
02:10
created

Image::toArray()   A

Complexity

Conditions 5
Paths 16

Size

Total Lines 28

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 13
CRAP Score 5

Importance

Changes 0
Metric Value
cc 5
nc 16
nop 0
dl 0
loc 28
ccs 13
cts 13
cp 1
crap 5
rs 9.1608
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A Image::__construct() 0 7 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Wszetko\Sitemap\Items;
5
6
/**
7
 * Class Image
8
 *
9
 * @package Wszetko\Sitemap\Items
10
 * @method setLoc($vloc)
11
 * @method getLoc()
12
 * @method setCaption($caption)
13
 * @method getCaption()
14
 * @method setGeoLocation($geoLocation)
15
 * @method getGeoLocation()
16
 * @method setTitle($title)
17
 * @method getTitle()
18
 * @method setLicense($licence)
19
 * @method getLicense()
20
 */
21
class Image extends Extension
22
{
23
    /**
24
     * Name of Namescapce
25
     */
26
    const NAMESPACE_NAME = 'image';
27
28
    /**
29
     * Namespace URL
30
     */
31
    const NAMESPACE_URL = 'http://www.google.com/schemas/sitemap-image/1.1';
32
33
    /**
34
     * Element name
35
     */
36
    const ELEMENT_NAME = 'image';
37
38
    /**
39
     * Location
40
     *
41
     * @var \Wszetko\Sitemap\Items\DataTypes\URLType
42
     */
43
    protected $loc;
44
45
    /**
46
     * The caption of the image.
47
     *
48
     * @var \Wszetko\Sitemap\Items\DataTypes\StringType
49
     */
50
    protected $caption;
51
52
    /**
53
     * The geographic location of the image.
54
     *
55
     * @var \Wszetko\Sitemap\Items\DataTypes\StringType
56
     */
57
    protected $geoLocation;
58
59
    /**
60
     * The title of the image.
61
     *
62
     * @var \Wszetko\Sitemap\Items\DataTypes\StringType
63
     */
64
    protected $title;
65
66
    /**
67
     * A URL to the license of the image.
68
     *
69
     * @var \Wszetko\Sitemap\Items\DataTypes\ExternalURLType
70
     */
71
    protected $license;
72
73
    /**
74
     * Image constructor
75
     *
76
     * @param string $loc
77
     *
78
     * @throws \ReflectionException
79
     */
80 7
    public function __construct(string $loc)
81
    {
82 7
        parent::__construct();
83
84 7
        $this->loc->setRequired(true);
85 7
        $this->setLoc($loc);
86 7
    }
87
}
88