Skip to content

Commit

Permalink
configureOptions(...) : protected => public
Browse files Browse the repository at this point in the history
As in Symfony\Component\Form\AbstractType the method

/**
     * Configures the options for this type.
     *
     * @param OptionsResolver $resolver The resolver for the options.
     */
    public function configureOptions(OptionsResolver $resolver)
    {
    }
  • Loading branch information
Lucas CHERIFI committed Oct 2, 2015
1 parent 692659e commit 824fe40
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions components/options_resolver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ It's a good practice to split the option configuration into a separate method::
$this->options = $resolver->resolve($options);
}

protected function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'host' => 'smtp.example.org',
Expand All @@ -192,7 +192,7 @@ than processing options. Second, sub-classes may now override the
// ...
class GoogleMailer extends Mailer
{
protected function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);

Expand All @@ -215,7 +215,7 @@ For example, to make the ``host`` option required, you can do::
{
// ...

protected function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver)
{
// ...
$resolver->setRequired('host');
Expand Down Expand Up @@ -243,7 +243,7 @@ one required option::
{
// ...

protected function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver)
{
// ...
$resolver->setRequired(array('host', 'username', 'password'));
Expand All @@ -263,7 +263,7 @@ retrieve the names of all required options::
// ...
class GoogleMailer extends Mailer
{
protected function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);

Expand Down Expand Up @@ -291,7 +291,7 @@ been set::
{
// ...

protected function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver)
{
// ...
$resolver->setRequired('host');
Expand All @@ -301,7 +301,7 @@ been set::
// ...
class GoogleMailer extends Mailer
{
protected function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);

Expand Down Expand Up @@ -336,7 +336,7 @@ correctly. To validate the types of the options, call
{
// ...

protected function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver)
{
// ...
$resolver->setAllowedTypes('host', 'string');
Expand Down Expand Up @@ -381,7 +381,7 @@ to verify that the passed option contains one of these values::
{
// ...

protected function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver)
{
// ...
$resolver->setDefault('transport', 'sendmail');
Expand Down Expand Up @@ -432,7 +432,7 @@ option. You can configure a normalizer by calling
{
// ...

protected function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver)
{
// ...

Expand All @@ -459,7 +459,7 @@ if you need to use other options during normalization::
class Mailer
{
// ...
protected function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver)
{
// ...
$resolver->setNormalizer('host', function ($options, $value) {
Expand Down Expand Up @@ -493,7 +493,7 @@ these options, you can return the desired default value::
class Mailer
{
// ...
protected function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver)
{
// ...
$resolver->setDefault('encryption', null);
Expand Down Expand Up @@ -525,7 +525,7 @@ the closure::
class Mailer
{
// ...
protected function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver)
{
// ...
$resolver->setDefaults(array(
Expand All @@ -537,7 +537,7 @@ the closure::

class GoogleMailer extends Mailer
{
protected function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);

Expand Down Expand Up @@ -568,7 +568,7 @@ comes from the default::
class Mailer
{
// ...
protected function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver)
{
// ...
$resolver->setDefault('port', 25);
Expand Down Expand Up @@ -600,7 +600,7 @@ be included in the resolved options if it was actually passed to
{
// ...

protected function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver)
{
// ...
$resolver->setDefined('port');
Expand Down Expand Up @@ -634,7 +634,7 @@ options in one go::
class Mailer
{
// ...
protected function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver)
{
// ...
$resolver->setDefined(array('port', 'encryption'));
Expand All @@ -655,7 +655,7 @@ let you find out which options are defined::
{
// ...

protected function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);

Expand Down Expand Up @@ -701,7 +701,7 @@ can change your code to do the configuration only once per class::
$this->options = self::$resolversByClass[$class]->resolve($options);
}

protected function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver)
{
// ...
}
Expand Down

0 comments on commit 824fe40

Please sign in to comment.