Skip to content

Commit 16116c5

Browse files
committed
Pass php 8.0
Signed-off-by: Witold Wasiczko <[email protected]>
1 parent 2b9d96d commit 16116c5

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/Model/ModuleVersioningModel.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@
1515
use function file_put_contents;
1616
use function in_array;
1717
use function is_array;
18+
use function is_bool;
1819
use function is_dir;
20+
use function is_int;
1921
use function is_readable;
22+
use function is_string;
2023
use function is_writable;
2124
use function mkdir;
2225
use function opendir;
@@ -375,11 +378,19 @@ protected function changeVersionArray($data, $previous, $version)
375378
{
376379
$result = [];
377380
foreach ($data as $key => $value) {
381+
if (is_int($key)) {
382+
$key = (string) $key;
383+
}
378384
$newKey = $this->changeVersionNamespace($key, $previous, $version);
379385
if (is_array($value)) {
380386
$result[$newKey] = $this->changeVersionArray($value, $previous, $version);
381387
} else {
382-
$result[$newKey] = $this->changeVersionNamespace($value, $previous, $version);
388+
if (is_bool($value) || is_int($value) || $value === null) {
389+
$value = (string) $value;
390+
}
391+
if (is_string($value)) {
392+
$result[$newKey] = $this->changeVersionNamespace($value, $previous, $version);
393+
}
383394
}
384395
}
385396
return $result;

0 commit comments

Comments
 (0)