Completed
Push — master ( 64636f...d810db )
by Michael
01:21
created

AbstractDevice::getDistributor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 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.' '.$this->getName();
0 ignored issues
show
Bug introduced by
The property getDistributor does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
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