Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
17 / 17 |
|
100.00% |
12 / 12 |
CRAP | |
100.00% |
1 / 1 |
| Waypoint | |
100.00% |
17 / 17 |
|
100.00% |
12 / 12 |
12 | |
100.00% |
1 / 1 |
| __toString | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setName | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getLat | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setLat | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getLon | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setLon | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getGuid | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setGuid | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getImage | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setImage | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace App\Entity; |
| 6 | |
| 7 | use Stringable; |
| 8 | use App\Repository\WaypointRepository; |
| 9 | use Doctrine\ORM\Mapping\Column; |
| 10 | use Doctrine\ORM\Mapping\Entity; |
| 11 | use Doctrine\ORM\Mapping\GeneratedValue; |
| 12 | use Doctrine\ORM\Mapping\Id; |
| 13 | |
| 14 | #[Entity(repositoryClass: WaypointRepository::class)] |
| 15 | class Waypoint implements Stringable |
| 16 | { |
| 17 | #[Column, Id, GeneratedValue(strategy: 'SEQUENCE')] |
| 18 | private ?int $id = null; |
| 19 | |
| 20 | #[Column] |
| 21 | private string $name = ''; |
| 22 | |
| 23 | #[Column(type: 'decimal', precision: 10, scale: 6)] |
| 24 | private float $lat = 0; |
| 25 | |
| 26 | #[Column(type: 'decimal', precision: 10, scale: 6)] |
| 27 | private float $lon = 0; |
| 28 | |
| 29 | #[Column(length: 100, nullable: true)] |
| 30 | private string $guid = ''; |
| 31 | |
| 32 | #[Column(length: 255, nullable: true)] |
| 33 | private ?string $image = null; |
| 34 | |
| 35 | public function __toString(): string |
| 36 | { |
| 37 | return (string)$this->getName(); |
| 38 | } |
| 39 | |
| 40 | public function getId(): ?int |
| 41 | { |
| 42 | return $this->id; |
| 43 | } |
| 44 | |
| 45 | public function getName(): ?string |
| 46 | { |
| 47 | return $this->name; |
| 48 | } |
| 49 | |
| 50 | public function setName(string $name): self |
| 51 | { |
| 52 | $this->name = $name; |
| 53 | |
| 54 | return $this; |
| 55 | } |
| 56 | |
| 57 | public function getLat(): ?float |
| 58 | { |
| 59 | return $this->lat; |
| 60 | } |
| 61 | |
| 62 | public function setLat(float $lat): self |
| 63 | { |
| 64 | $this->lat = $lat; |
| 65 | |
| 66 | return $this; |
| 67 | } |
| 68 | |
| 69 | public function getLon(): ?float |
| 70 | { |
| 71 | return $this->lon; |
| 72 | } |
| 73 | |
| 74 | public function setLon(float $lon): self |
| 75 | { |
| 76 | $this->lon = $lon; |
| 77 | |
| 78 | return $this; |
| 79 | } |
| 80 | |
| 81 | public function getGuid(): ?string |
| 82 | { |
| 83 | return $this->guid; |
| 84 | } |
| 85 | |
| 86 | public function setGuid(string $guid): self |
| 87 | { |
| 88 | $this->guid = $guid; |
| 89 | |
| 90 | return $this; |
| 91 | } |
| 92 | |
| 93 | public function getImage(): ?string |
| 94 | { |
| 95 | return $this->image; |
| 96 | } |
| 97 | |
| 98 | public function setImage(?string $image): static |
| 99 | { |
| 100 | $this->image = $image; |
| 101 | |
| 102 | return $this; |
| 103 | } |
| 104 | } |