AbstractDevice   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 25
ccs 4
cts 8
cp 0.5
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getFullName() 0 4 1
A getDistributor() 0 4 1
A hasBarometer() 0 4 1
A getNameOfClass() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Runalyze Device List.
5
 *
6
 * (c) RUNALYZE <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Runalyze\Devices\Device;
13
14
use Runalyze\Devices\Distributor\DistributorProfile;
15
16
abstract class AbstractDevice implements DeviceInterface
17
{
18
    public function getFullName()
19
    {
20
        return $this->getDistributor()->getName().' '.$this->getName();
21
    }
22
23 1
    public function getDistributor()
24
    {
25 1
        return DistributorProfile::get($this->getDistributorEnum());
26
    }
27
28
    public function hasBarometer()
29
    {
30
        return false;
31
    }
32
33
    /**
34
     * @return string
35
     */
36 1
    public function getNameOfClass()
37
    {
38 1
        return static::class;
39
    }
40
}
41