IntegerType::getValue()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 2
eloc 2
c 1
b 1
f 0
nc 2
nop 0
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 2
rs 10
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\DataTypes;
15
16
/**
17
 * Class IntegerType.
18
 *
19
 * @package Wszetko\Sitemap\Items\DataTypes
20
 */
21
class IntegerType extends FloatType
22
{
23
    /**
24
     * @inheritDoc
25
     */
26 42
    public function getValue()
27
    {
28 42
        $value = parent::getValue();
29
30 42
        return null === $value ? null : (string) round((float) $value);
31
    }
32
}
33