Completed
Push — master ( 2095ba...9a6e4e )
by Patrick
02:15
created

InstrumentString   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 29
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getNumber() 0 4 1
A getPhysicalLength() 0 4 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace ExtendedStrings\Strings;
6
7
class InstrumentString extends VibratingString implements InstrumentStringInterface
8
{
9
    private $physicalLength;
10
    private $number;
11
12
    public function __construct(float $frequency, float $physicalLength, int $number)
13
    {
14
        $this->number = $number;
15
        $this->physicalLength = $physicalLength;
16
17
        parent::__construct($frequency);
18
    }
19
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function getNumber(): int
24
    {
25
        return $this->number;
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function getPhysicalLength(): float
32
    {
33
        return $this->physicalLength;
34
    }
35
}
36