Skip to content

Commit e967638

Browse files
Merge pull request #70 from snapshotpl/allow-php8
Allow php8 in composer
2 parents 0a7331b + 16116c5 commit e967638

File tree

3 files changed

+73
-105
lines changed

3 files changed

+73
-105
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
}
2727
},
2828
"require": {
29-
"php": "^7.3",
29+
"php": "^7.3 || ~8.0.0",
3030
"laminas-api-tools/api-tools": "^1.4",
3131
"laminas-api-tools/api-tools-admin-ui": "^1.3.9",
3232
"laminas-api-tools/api-tools-api-problem": "^1.3",
@@ -56,6 +56,7 @@
5656
"webmozart/assert": "^1.10"
5757
},
5858
"require-dev": {
59+
"ext-sqlite3": "*",
5960
"alcaeus/mongo-php-adapter": "^1.2",
6061
"laminas/laminas-coding-standard": "~2.3.0",
6162
"laminas/laminas-config": "^2.6 || ^3.2",

composer.lock

Lines changed: 59 additions & 103 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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)