Speed   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 17
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A fromAmazonRequest() 0 5 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MaxBeckers\AmazonAlexa\Request;
6
7
/**
8
 * @deprecated
9
 */
10
class Speed
11
{
12
    /**
13
     * @param float $speedInMetersPerSecond Speed in meters per second
14
     * @param float|null $accuracyInMetersPerSecond Accuracy of speed measurement in meters per second
15
     */
16 1
    public function __construct(
17
        public float $speedInMetersPerSecond,
18
        public ?float $accuracyInMetersPerSecond = null,
19
    ) {
20 1
    }
21
22 1
    public static function fromAmazonRequest(array $amazonRequest): self
23
    {
24 1
        return new self(
25 1
            speedInMetersPerSecond: (float) ($amazonRequest['speedInMetersPerSecond']),
26 1
            accuracyInMetersPerSecond: isset($amazonRequest['accuracyInMetersPerSecond']) ? (float) ($amazonRequest['accuracyInMetersPerSecond']) : null,
27 1
        );
28
    }
29
}
30