DateType::toArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Kwk\Geckoboard\Dataset\Type;
4
5
use Kwk\Geckoboard\Dataset\TypeInterface;
6
7
class DateType implements TypeInterface
8
{
9
    /**
10
     * @var string
11
     */
12
    private $name;
13
14
    /**
15
     * @param string $name
16
     */
17 3
    public function __construct($name)
18
    {
19 3
        $this->name = $name;
20 3
    }
21
22
    /**
23
     * {@inheritDoc}
24
     */
25 2
    public function toArray()
26
    {
27
        return [
28 2
            'type' => 'date',
29 2
            'name' => $this->name,
30
        ];
31
    }
32
}
33