Skip to content

Commit 3674672

Browse files
committed
support for PHP 8.5
1 parent cedc41f commit 3674672

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
php: ['8.1', '8.2', '8.3', '8.4']
10+
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
1111

1212
fail-fast: false
1313

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616
],
1717
"require": {
18-
"php": "8.1 - 8.4",
18+
"php": "8.1 - 8.5",
1919
"nette/component-model": "^3.1",
2020
"nette/http": "^3.3",
2121
"nette/utils": "^4.0.4"

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The recommended way to install is via Composer:
4444
composer require nette/forms
4545
```
4646

47-
It requires PHP version 8.1 and supports PHP up to 8.4.
47+
It requires PHP version 8.1 and supports PHP up to 8.5.
4848

4949

5050
Client-side support can be installed with npm or yarn:

src/Forms/Controls/ChoiceControl.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ public function setValue($value)
6969
*/
7070
public function getValue(): mixed
7171
{
72-
return array_key_exists($this->value, $this->items)
72+
return $this->value !== null
73+
&& array_key_exists($this->value, $this->items)
7374
&& !isset($this->disabled[$this->value])
7475
? $this->value
7576
: null;

src/Forms/Controls/SelectBox.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function getControl(): Nette\Utils\Html
109109
if ($this->isRequired()) {
110110
$attrs['hidden:'][$promptKey] = $attrs['disabled:'][$promptKey] = true;
111111
// disabled & selected for Safari, hidden for other browsers
112-
$selected = array_key_exists($this->value, $this->getItems()) ? $this->value : $promptKey;
112+
$selected = $this->value !== null && array_key_exists($this->value, $this->getItems()) ? $this->value : $promptKey;
113113
}
114114
}
115115

0 commit comments

Comments
 (0)