VibratingString::getFrequency()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace ExtendedStrings\Strings;
6
7
class VibratingString implements VibratingStringInterface
8
{
9
    private $frequency;
10
    private $physicalLength;
11
12
    /**
13
     * VibratingString constructor.
14
     *
15
     * @param float $frequency      The open string frequency (in Hz).
16
     * @param float $physicalLength The physical length of the string (in mm).
17
     */
18
    public function __construct(float $frequency, float $physicalLength = 500.0)
19
    {
20
        $this->frequency = $frequency;
21
        $this->physicalLength = $physicalLength;
22
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function getFrequency(): float
28
    {
29
        return $this->frequency;
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function getPhysicalLength(): float
36
    {
37
        return $this->physicalLength;
38
    }
39
}
40