Image   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 66
ccs 4
cts 4
cp 1
rs 10
wmc 1

1 Method

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