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 e463c1e

Browse filesBrowse files
author
Dorian Villet
committed
[OptionsResolver] Fix syntax errors in code examples (missing in_array closing slashes)
This pull request fixes 2 syntax errors when using `in_array()` in conditions (missing the last closing slash). It also adds a missing `use` statement in one code example.
1 parent cf7db08 commit e463c1e
Copy full SHA for e463c1e

File tree

Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed

‎components/options_resolver.rst

Copy file name to clipboardExpand all lines: components/options_resolver.rst
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ value you guess based on the host. You can do that easily by using a
199199
Closure as the default value::
200200

201201
use Symfony\Component\OptionsResolver\Options;
202+
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
202203

203204
// ...
204205
protected function setDefaultOptions(OptionsResolverInterface $resolver)
@@ -207,7 +208,7 @@ Closure as the default value::
207208

208209
$resolver->setDefaults(array(
209210
'port' => function (Options $options) {
210-
if (in_array($options['host'], array('127.0.0.1', 'localhost')) {
211+
if (in_array($options['host'], array('127.0.0.1', 'localhost'))) {
211212
return 80;
212213
}
213214
@@ -305,7 +306,7 @@ need to use the other options for normalizing::
305306

306307
$resolver->setNormalizers(array(
307308
'host' => function (Options $options, $value) {
308-
if (!in_array(substr($value, 0, 7), array('http://', 'https://')) {
309+
if (!in_array(substr($value, 0, 7), array('http://', 'https://'))) {
309310
if ($options['ssl']) {
310311
$value = 'https://'.$value;
311312
} else {

0 commit comments

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