Skip to content

Commit cdb63c0

Browse files
committed
Merge branch '5.4' into 6.2
* 5.4: add `OptionsResolverIntrospector`usage doc
2 parents 6f2aa41 + ad6e24a commit cdb63c0

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
@@ -929,3 +929,21 @@ method ``clearOptionsConfig()`` and call it periodically::
929929

930930
That's it! You now have all the tools and knowledge needed to process
931931
options in your code.
932+
933+
Getting More Insights
934+
~~~~~~~~~~~~~~~~~~~~~
935+
936+
Use the ``OptionsResolverIntrospector`` to inspect the options definitions
937+
inside an ``OptionsResolver`` instance::
938+
939+
use Symfony\Component\OptionsResolver\Debug\OptionsResolverIntrospector;
940+
use Symfony\Component\OptionsResolver\OptionsResolver;
941+
942+
$resolver = new OptionsResolver();
943+
$resolver->setDefaults([
944+
'host' => 'smtp.example.org',
945+
'port' => 25,
946+
]);
947+
948+
$introspector = new OptionsResolverIntrospector($resolver);
949+
$introspector->getDefault('host'); // Retrieves "smtp.example.org"

0 commit comments

Comments
 (0)