Passed
Push — main ( bd6751...4aef09 )
by Miaad
10:17
created

location::mapLink()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 2
rs 10
1
<?php
2
3
namespace BPT\types;
4
5
use stdClass;
6
7
/**
8
 * This object represents a point on the map.
9
 */
10
class location extends types {
0 ignored issues
show
Bug introduced by
The type BPT\types\types was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
    /** Keep all of properties which has sub properties */
12
    private const subs = [];
13
14
    /** Longitude as defined by sender */
15
    public float $longitude;
16
17
    /** Latitude as defined by sender */
18
    public float $latitude;
19
20
    /** Optional. The radius of uncertainty for the location, measured in meters; 0-1500 */
21
    public null|float $horizontal_accuracy = null;
22
23
    /**
24
     * Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For
25
     * active live locations only.
26
     */
27
    public null|int $live_period = null;
28
29
    /** Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only. */
30
    public null|int $heading = null;
31
32
    /**
33
     * Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent
34
     * live locations only.
35
     */
36
    public null|int $proximity_alert_radius = null;
37
38
39
    public function __construct(stdClass|null $object = null) {
40
        if ($object != null) {
41
            parent::__construct($object, self::subs);
42
        }
43
    }
44
45
    public function mapLink (): string {
46
        return "https://www.google.com/maps/search/$this->latitude,$this->longitude";
47
    }
48
}
49