8000 Merge branch '6.2' into 6.3 · symfony/symfony-docs@d5433ca · GitHub
[go: up one dir, main page]

Skip to content

Commit d5433ca

Browse files
committed
Merge branch '6.2' into 6.3
* 6.2: add `OptionsResolverIntrospector`usage doc
2 parents 4f7b946 + cdb63c0 commit d5433ca

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

components/options_resolver.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,3 +953,21 @@ method ``clearOptionsConfig()`` and call it periodically::
953953

954954
That's it! You now have all the tools and knowledge needed to process
955955
options in your code.
956+
957+
Getting More Insights
958+
~~~~~~~~~~~~~~~~~~~~~
959+
960+
Use the ``OptionsResolverIntrospector`` to inspect the options definitions
961+
inside an ``OptionsResolver`` instance::
962+
963+
use Symfony\Component\OptionsResolver\Debug\OptionsResolverIntrospector;
964+
use Symfony\Component\OptionsResolver\OptionsResolver;
965+
966+
$resolver = new OptionsResolver();
967+
$resolver->setDefaults([
968+
'host' => 'smtp.example.org',
969+
'port' => 25,
970+
]);
971+
972+
$introspector = new OptionsResolverIntrospector($resolver);
973+
$introspector->getDefault('host'); // Retrieves "smtp.example.org"

0 commit comments

Comments
 (0)
0