Skip to content

Commit ca50eeb

Browse files
committed
Minor tweaks
1 parent e44b2fb commit ca50eeb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

components/options_resolver.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,19 +305,20 @@ correctly. To validate the types of the options, call
305305

306306
// specify multiple allowed types
307307
$resolver->setAllowedTypes('port', ['null', 'int']);
308-
// which is similar to
308+
// if you prefer, you can also use the following equivalent syntax
309309
$resolver->setAllowedTypes('port', 'int|null');
310310

311311
// check all items in an array recursively for a type
312312
$resolver->setAllowedTypes('dates', 'DateTime[]');
313313
$resolver->setAllowedTypes('ports', 'int[]');
314+
// the following syntax means "an array of integers or an array of strings"
314315
$resolver->setAllowedTypes('endpoints', '(int|string)[]');
315316
}
316317
}
317318

318319
.. versionadded:: 7.3
319320

320-
Union of type, using the ``|`` syntax, was introduced in Symfony 7.3.
321+
Defining type unions with the ``|`` syntax was introduced in Symfony 7.3.
321322

322323
You can pass any type for which an ``is_<type>()`` function is defined in PHP.
323324
You may also pass fully qualified class or interface names (which is checked

0 commit comments

Comments
 (0)