Skip to content

Commit 674c0e1

Browse files
committed
PHP 7.4 support
1 parent db8d6ed commit 674c0e1

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010
],
1111
"require": {
12-
"php": ">=8.0.0"
12+
"php": "^7.4 || ^8.0"
1313
},
1414
"require-dev": {
1515
"phpstan/phpstan": "^0.12.52",
@@ -24,7 +24,7 @@
2424
},
2525
"config": {
2626
"platform": {
27-
"php": "8.0.0"
27+
"php": "7.4.0"
2828
}
2929
},
3030
"scripts": {

src/SelectboxItem.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,20 @@
77

88
final class SelectboxItem
99
{
10-
private int|string $id;
10+
/** @var int|string */
11+
private $id;
1112

1213
private string $name;
1314

14-
private int|string|null $parentId;
15+
/** @var int|string|null */
16+
private $parentId;
1517

1618

17-
public function __construct(int|string $id, string $name, int|string|null $parentId = null)
19+
/**
20+
* @param int|string $id
21+
* @param int|string|null $parentId
22+
*/
23+
public function __construct($id, string $name, $parentId = null)
1824
{
1925
$this->id = $id;
2026
$this->name = $name;

src/SelectboxTree.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,10 @@ public function setNameFormatter(NameFormatter $nameFormatter): void
9292
* Build category tree to simple selectbox array.
9393
*
9494
* @param string[][]|null[][]|null $categories
95+
* @param int|string|null $parent
9596
* @return mixed[][]
9697
*/
97-
private function serializeCategoriesToSelectbox(?array $categories, int $level = 0, int|string|null $parent = null): array
98+
private function serializeCategoriesToSelectbox(?array $categories, int $level = 0, $parent = null): array
9899
{
99100
static $usedIds = [];
100101

0 commit comments

Comments
 (0)