Skip to content

Commit 02ede6b

Browse files
committed
fix: support php 8.0, 8.1
1 parent e68be47 commit 02ede6b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Provider/Photon/Photon.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,13 @@ private function buildLayerFilterQuery(mixed $layers): string
183183
$layers = [$layers];
184184
}
185185

186+
if (!is_array($layers)) {
187+
$layers = iterator_to_array($layers);
188+
}
189+
186190
return implode('', array_map(
187191
static fn ($layer) => sprintf('&layer=%s', $layer),
188-
array_filter(iterator_to_array($layers), is_scalar(...)),
192+
array_filter($layers, static fn ($layer) => is_scalar($layer)),
189193
));
190194
}
191195

0 commit comments

Comments
 (0)