Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit7a0df5e

Browse files
committed
Merge pull requestsymfony#3053 from gnutix/2.1
[OptionsResolver] Fix syntax errors in code examples (missing in_array closing slashes)
2 parentsea8db68 +e463c1e commit7a0df5e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎components/options_resolver.rst

Lines 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)

[8]ページ先頭

©2009-2025 Movatter.jp