Skip to content

Commit df44732

Browse files
committed
Merge branch '2.1' into 2.2
2 parents 758e032 + 7a0df5e commit df44732

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
@@ -194,6 +194,7 @@ value you guess based on the host. You can do that easily by using a
194194
Closure as the default value::
195195

196196
use Symfony\Component\OptionsResolver\Options;
197+
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
197198

198199
// ...
199200
protected function setDefaultOptions(OptionsResolverInterface $resolver)
@@ -202,7 +203,7 @@ Closure as the default value::
202203

203204
$resolver->setDefaults(array(
204205
'port' => function (Options $options) {
205-
if (in_array($options['host'], array('127.0.0.1', 'localhost')) {
206+
if (in_array($options['host'], array('127.0.0.1', 'localhost'))) {
206207
return 80;
207208
}
208209

@@ -300,7 +301,7 @@ need to use the other options for normalizing::
300301

301302
$resolver->setNormalizers(array(
302303
'host' => function (Options $options, $value) {
303-
if (!in_array(substr($value, 0, 7), array('http://', 'https://')) {
304+
if (!in_array(substr($value, 0, 7), array('http://', 'https://'))) {
304305
if ($options['ssl']) {
305306
$value = 'https://'.$value;
306307
} else {

0 commit comments

Comments
 (0)