File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff 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
322323You can pass any type for which an ``is_<type>() `` function is defined in PHP.
323324You may also pass fully qualified class or interface names (which is checked
You can’t perform that action at this time.
0 commit comments