Skip to content

Commit 385cadb

Browse files
committed
1 parent 6b7a17f commit 385cadb

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

src/FormElement/SelectElement.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class SelectElement extends BaseFormElement
3232
/**
3333
* Get the option with specified value
3434
*
35-
* @param string|int|null $value
35+
* @param string|int $value
3636
*
3737
* @return ?SelectOption
3838
*/
@@ -119,7 +119,7 @@ public function getNameAttribute()
119119
/**
120120
* Make the selectOption for the specified value and the label
121121
*
122-
* @param string|int|null $value Value of the option
122+
* @param string|int $value Value of the option
123123
* @param string|array $label Label of the option
124124
*
125125
* @return SelectOption|HtmlElement

tests/DocumentationFormsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function testSelectElement()
2525
$form->addElement('select', 'customer', [
2626
'label' => 'Customer',
2727
'options' => [
28-
null => 'Please choose',
28+
'' => 'Please choose',
2929
'1' => 'The one',
3030
'4' => 'Four',
3131
'5' => 'Hi five',
@@ -57,7 +57,7 @@ public function testSetValues()
5757
$form->addElement('select', 'customer', [
5858
'label' => 'Customer',
5959
'options' => [
60-
null => 'Please choose',
60+
'' => 'Please choose',
6161
'1' => 'The one',
6262
'4' => 'Four',
6363
'5' => 'Hi five',

tests/FormElement/FieldsetElementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class FieldsetElementTest extends TestCase
1616
{
1717
private const SELECT_OPTIONS_TO_TEST = [
18-
null => 'Nothing',
18+
'' => 'Nothing',
1919
1 => 'One',
2020
'two' => 2,
2121
];

tests/FormElement/SelectElementTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function testFlatOptions()
1717
$select = new SelectElement('elname', [
1818
'label' => 'Customer',
1919
'options' => [
20-
null => 'Please choose',
20+
'' => 'Please choose',
2121
'1' => 'The one',
2222
'4' => 'Four',
2323
'5' => 'Hi five',
@@ -43,7 +43,7 @@ public function testOptionValidity()
4343
'label' => 'Customer',
4444
'value' => '3',
4545
'options' => [
46-
null => 'Please choose',
46+
'' => 'Please choose',
4747
'1' => 'The one',
4848
'4' => 'Four',
4949
'5' => 'Hi five',
@@ -72,7 +72,7 @@ public function testSelectingDisabledOptionIsNotPossible()
7272
'label' => 'Customer',
7373
'value' => '4',
7474
'options' => [
75-
null => 'Please choose',
75+
'' => 'Please choose',
7676
'1' => 'The one',
7777
'4' => 'Four',
7878
'5' => 'Hi five',
@@ -93,7 +93,7 @@ public function testNestedOptions()
9393
$select = new SelectElement('elname', [
9494
'label' => 'Customer',
9595
'options' => [
96-
null => 'Please choose',
96+
'' => 'Please choose',
9797
'Some Options' => [
9898
'1' => 'The one',
9999
'4' => 'Four',
@@ -125,7 +125,7 @@ public function testDisabledNestedOptions()
125125
$select = new SelectElement('elname', [
126126
'label' => 'Customer',
127127
'options' => [
128-
null => 'Please choose',
128+
'' => 'Please choose',
129129
'Some options' => [
130130
'1' => 'The one',
131131
'4' => 'Four',
@@ -160,7 +160,7 @@ public function testDeeplyDisabledNestedOptions()
160160
$select = new SelectElement('elname', [
161161
'label' => 'Customer',
162162
'options' => [
163-
null => 'Please choose',
163+
'' => 'Please choose',
164164
'Some options' => [
165165
'1' => 'The one',
166166
'4' => [
@@ -204,7 +204,7 @@ public function testDefaultValueIsSelected()
204204
'label' => 'Customer',
205205
'value' => '1',
206206
'options' => [
207-
null => 'Please choose',
207+
'' => 'Please choose',
208208
'1' => 'The one',
209209
'4' => 'Four',
210210
'5' => 'Hi five',
@@ -228,7 +228,7 @@ public function testSetValueSelectsAnOption()
228228
$select = new SelectElement('elname', [
229229
'label' => 'Customer',
230230
'options' => [
231-
null => 'Please choose',
231+
'' => 'Please choose',
232232
'1' => 'The one',
233233
'4' => 'Four',
234234
'5' => 'Hi five',
@@ -280,7 +280,7 @@ public function testSetArrayAsValueWithoutMultipleAttributeThrowsException()
280280
$select = new SelectElement('elname', [
281281
'label' => 'Customer',
282282
'options' => [
283-
null => 'Please choose',
283+
'' => 'Please choose',
284284
'1' => 'The one',
285285
'4' => 'Four',
286286
'5' => 'Hi five',
@@ -301,7 +301,7 @@ public function testSetNonArrayAsValueWithMultipleAttributeThrowsException()
301301
'label' => 'Customer',
302302
'multiple' => true,
303303
'options' => [
304-
null => 'Please choose',
304+
'' => 'Please choose',
305305
'1' => 'The one',
306306
'4' => 'Four',
307307
'5' => 'Hi five',
@@ -323,7 +323,7 @@ public function testSetArrayAsValueWithMultipleAttributeSetTheOptions()
323323
$select = new SelectElement('elname', [
324324
'label' => 'Customer',
325325
'options' => [
326-
null => 'Please choose',
326+
'' => 'Please choose',
327327
'1' => 'The one',
328328
'4' => 'Four',
329329
'5' => 'Hi five',

0 commit comments

Comments
 (0)