[OptionsResolver] Fixed typos

This commit is contained in:
Bernhard Schussek 2012-05-10 19:26:05 +02:00
parent 256b7081a4
commit 95454f5f6b
3 changed files with 19 additions and 15 deletions

View File

@ -57,12 +57,12 @@ class OptionsResolver
/**
* Sets default option values.
*
* @param array $options A list of option names as keys and default values
* as values. The option values may be closures
* of the following signatures:
* @param array $defaultValues A list of option names as keys and default values
* as values. The option values may be closures
* of the following signatures:
*
* - function (Options $options)
* - function (Options $options, $previousValue)
* - function (Options $options)
* - function (Options $options, $previousValue)
*/
public function setDefaults(array $defaultValues)
{
@ -80,11 +80,11 @@ class OptionsResolver
* performance if the previous default value is calculated by an expensive
* closure.
*
* @param array $options A list of option names as keys and default values
* as values. The option values may be closures
* of the following signature:
* @param array $defaultValues A list of option names as keys and default values
* as values. The option values may be closures
* of the following signature:
*
* - function (Options $options)
* - function (Options $options)
*/
public function replaceDefaults(array $defaultValues)
{
@ -214,10 +214,11 @@ class OptionsResolver
* Validates that the given option names exist and throws an exception
* otherwise.
*
* @param array $optionNames A list of option names.
* @param array $optionNames A list of option names.
*
* @throws InvalidOptionsException If any of the options has not been
* defined.
* @throws InvalidOptionsException If any of the options has not been
* defined.
* @throws MissingOptionsException If a required option is missing.
*/
private function validateOptionNames(array $optionNames)
{

View File

@ -22,7 +22,7 @@ possible, and may only be one of "male" and "female".
public function __construct(array $options = array())
{
$resolver = new OptionsResolver();
$this->configureOptions($resolver);
$this->configure($resolver);
$this->options = $resolver->resolve($options);
}
@ -53,7 +53,7 @@ possible, and may only be one of "male" and "female".
We can now easily instantiate a Person object:
// 'gender' is implicitely set to 'female'
// 'gender' is implicitly set to 'female'
$person = new Person(array(
'firstName' => 'Jane',
'lastName' => 'Doe',

View File

@ -16,7 +16,10 @@ use Symfony\Component\OptionsResolver\Options;
class OptionsResolverTest extends \PHPUnit_Framework_TestCase
{
private $options;
/**
* @var OptionsResolver
*/
private $resolver;
protected function setUp()
{