Skip to content

Commit 659c3a0

Browse files
committed
fix phpcs
1 parent 3f17b5f commit 659c3a0

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/Map/CHANGELOG.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
- Add method `Symfony\UX\Map\Renderer\AbstractRenderer::tapOptions()`, to allow Renderer to modify options before rendering a Map.
66
- Add `ux_map.google_maps.default_map_id` configuration to set the Google ``Map ID``
7-
8-
## 2.22
9-
107
- Add `Polyline` support
118

129
## 2.20

src/Map/src/Map.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,21 +103,22 @@ public function addPolygon(Polygon $polygon): self
103103
public function addPolyline(Polyline $polyline): self
104104
{
105105
$this->polylines[] = $polyline;
106+
106107
return $this;
107108
}
108-
109+
109110
public function toArray(): array
110111
{
111112
if (!$this->fitBoundsToMarkers) {
112113
if (null === $this->center) {
113114
throw new InvalidArgumentException('The map "center" must be explicitly set when not enabling "fitBoundsToMarkers" feature.');
114115
}
115-
116+
116117
if (null === $this->zoom) {
117118
throw new InvalidArgumentException('The map "zoom" must be explicitly set when not enabling "fitBoundsToMarkers" feature.');
118119
}
119120
}
120-
121+
121122
return [
122123
'center' => $this->center?->toArray(),
123124
'zoom' => $this->zoom,
@@ -148,23 +149,23 @@ public static function fromArray(array $map): self
148149
if (isset($map['center'])) {
149150
$map['center'] = Point::fromArray($map['center']);
150151
}
151-
152+
152153
if (isset($map['zoom']) || isset($map['center'])) {
153154
$map['fitBoundsToMarkers'] = false;
154155
}
155-
156+
156157
$map['markers'] ??= [];
157158
if (!\is_array($map['markers'])) {
158159
throw new InvalidArgumentException('The "markers" parameter must be an array.');
159160
}
160161
$map['markers'] = array_map(Marker::fromArray(...), $map['markers']);
161-
162+
162163
$map['polygons'] ??= [];
163164
if (!\is_array($map['polygons'])) {
164165
throw new InvalidArgumentException('The "polygons" parameter must be an array.');
165166
}
166167
$map['polygons'] = array_map(Polygon::fromArray(...), $map['polygons']);
167-
168+
168169
$map['polylines'] ??= [];
169170
if (!\is_array($map['polylines'])) {
170171
throw new InvalidArgumentException('The "polylines" parameter must be an array.');

0 commit comments

Comments
 (0)