@@ -22,11 +22,6 @@ You can install the component in 2 different ways:
22
22
Notes on Previous Versions
23
23
--------------------------
24
24
25
- .. versionadded :: 2.6
26
- This documentation was written for Symfony 2.6 and later. If you use an older
27
- version, please `read the Symfony 2.5 documentation `_. For a list of changes,
28
- see the `CHANGELOG `_.
29
-
30
25
Usage
31
26
-----
32
27
@@ -222,10 +217,6 @@ For example, to make the ``host`` option required, you can do::
222
217
}
223
218
}
224
219
225
- .. versionadded :: 2.6
226
- As of Symfony 2.6, ``setRequired() `` accepts both an array of options or a
227
- single option. Prior to 2.6, you could only pass arrays.
228
-
229
220
If you omit a required option, a
230
221
:class: `Symfony\\ Component\\ OptionsResolver\\ Exception\\ MissingOptionsException `
231
222
will be thrown::
@@ -250,11 +241,6 @@ one required option::
250
241
}
251
242
}
252
243
253
- .. versionadded :: 2.6
254
- The methods :method: `Symfony\\ Component\\ OptionsResolver\\ OptionsResolver::isRequired `
255
- and :method: `Symfony\\ Component\\ OptionsResolver\\ OptionsResolver::getRequiredOptions `
256
- were introduced in Symfony 2.6.
257
-
258
244
Use :method: `Symfony\\ Component\\ OptionsResolver\\ OptionsResolver::isRequired ` to find
259
245
out if an option is required. You can use
260
246
:method: `Symfony\\ Component\\ OptionsResolver\\ OptionsResolver::getRequiredOptions ` to
@@ -275,11 +261,6 @@ retrieve the names of all required options::
275
261
}
276
262
}
277
263
278
- .. versionadded :: 2.6
279
- The methods :method: `Symfony\\ Component\\ OptionsResolver\\ OptionsResolver::isMissing `
280
- and :method: `Symfony\\ Component\\ OptionsResolver\\ OptionsResolver::getMissingOptions `
281
- were introduced in Symfony 2.6.
282
-
283
264
If you want to check whether a required option is still missing from the default
284
265
options, you can use :method: `Symfony\\ Component\\ OptionsResolver\\ OptionsResolver::isMissing `.
285
266
The difference between this and :method: `Symfony\\ Component\\ OptionsResolver\\ OptionsResolver::isRequired `
@@ -362,11 +343,6 @@ is thrown::
362
343
In sub-classes, you can use :method: `Symfony\\ Component\\ OptionsResolver\\ OptionsResolver::addAllowedTypes `
363
344
to add additional allowed types without erasing the ones already set.
364
345
365
- .. versionadded :: 2.6
366
- Before Symfony 2.6, ``setAllowedTypes() `` and ``addAllowedTypes() `` expected
367
- the values to be given as an array mapping option names to allowed types:
368
- ``$resolver->setAllowedTypes(array('port' => array('null', 'int'))); ``
369
-
370
346
Value Validation
371
347
~~~~~~~~~~~~~~~~
372
348
@@ -413,11 +389,6 @@ returns ``true`` for acceptable values and ``false`` for invalid values::
413
389
In sub-classes, you can use :method: `Symfony\\ Component\\ OptionsResolver\\ OptionsResolver::addAllowedValues `
414
390
to add additional allowed values without erasing the ones already set.
415
391
416
- .. versionadded :: 2.6
417
- Before Symfony 2.6, ``setAllowedValues() `` and ``addAllowedValues() `` expected
418
- the values to be given as an array mapping option names to allowed values:
419
- ``$resolver->setAllowedValues(array('transport' => array('sendmail', 'mail', 'smtp'))); ``
420
-
421
392
Option Normalization
422
393
~~~~~~~~~~~~~~~~~~~~
423
394
@@ -448,11 +419,6 @@ option. You can configure a normalizer by calling
448
419
}
449
420
}
450
421
451
- .. versionadded :: 2.6
452
- The method :method: `Symfony\\ Component\\ OptionsResolver\\ OptionsResolver::setNormalizer `
453
- was introduced in Symfony 2.6. Before, you had to use
454
- :method: `Symfony\\ Component\\ OptionsResolver\\ OptionsResolver::setNormalizers `.
455
-
456
422
The normalizer receives the actual ``$value `` and returns the normalized form.
457
423
You see that the closure also takes an ``$options `` parameter. This is useful
458
424
if you need to use other options during normalization::
@@ -587,11 +553,6 @@ comes from the default::
587
553
}
588
554
}
589
555
590
- .. versionadded :: 2.6
591
- The method :method: `Symfony\\ Component\\ OptionsResolver\\ OptionsResolver::setDefined `
592
- was introduced in Symfony 2.6. Before, you had to use
593
- :method: `Symfony\\ Component\\ OptionsResolver\\ OptionsResolver::setOptional `.
594
-
595
556
You can use :method: `Symfony\\ Component\\ OptionsResolver\\ OptionsResolver::setDefined `
596
557
to define an option without setting a default value. Then the option will only
597
558
be included in the resolved options if it was actually passed to
@@ -643,11 +604,6 @@ options in one go::
643
604
}
644
605
}
645
606
646
- .. versionadded :: 2.6
647
- The method :method: `Symfony\\ Component\\ OptionsResolver\\ OptionsResolver::isDefined `
648
- and :method: `Symfony\\ Component\\ OptionsResolver\\ OptionsResolver::getDefinedOptions `
649
- were introduced in Symfony 2.6.
650
-
651
607
The methods :method: `Symfony\\ Component\\ OptionsResolver\\ OptionsResolver::isDefined `
652
608
and :method: `Symfony\\ Component\\ OptionsResolver\\ OptionsResolver::getDefinedOptions `
653
609
let you find out which options are defined::
0 commit comments