Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 887f6f5

Browse filesBrowse files
PululuKjaviereguiluz
authored andcommitted
add OptionsResolverIntrospectorusage doc
1 parent cf269d6 commit 887f6f5
Copy full SHA for 887f6f5

File tree

1 file changed

+21
-0
lines changed
Filter options

1 file changed

+21
-0
lines changed

‎components/options_resolver.rst

Copy file name to clipboardExpand all lines: components/options_resolver.rst
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,3 +944,24 @@ method ``clearOptionsConfig()`` and call it periodically::
944944

945945
That's it! You now have all the tools and knowledge needed to process
946946
options in your code.
947+
948+
Get More Insights
949+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
950+
951+
The `OptionsResolverIntrospector` inspect options definitions inside an `OptionsResolver` instance.
952+
953+
method::
954+
955+
use Symfony\Component\OptionsResolver\Debug\OptionsResolverIntrospector;
956+
use Symfony\Component\OptionsResolver\OptionsResolver;
957+
958+
$resolver = new OptionsResolver();
959+
$resolver->setDefaults([
960+
'host' => 'smtp.example.org',
961+
'port' => 25,
962+
]);
963+
964+
$introspector = new OptionsResolverIntrospector($resolver);
965+
$introspector->getDefault('host'); // Retrieves "smtp.example.org"
966+
967+

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.