Skip to content

Commit

Permalink
[Form] fix some docblocks and type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Jan 30, 2019
1 parent 3cfb558 commit d63bbd9
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/AbstractType.php
Expand Up @@ -52,7 +52,7 @@ public function configureOptions(OptionsResolver $resolver)
*/
public function getBlockPrefix()
{
return StringUtil::fqcnToBlockPrefix(\get_class($this));
return StringUtil::fqcnToBlockPrefix(\get_class($this)) ?: '';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/FormBuilder.php
Expand Up @@ -40,7 +40,7 @@ class FormBuilder extends FormConfigBuilder implements \IteratorAggregate, FormB
/**
* Creates a new form builder.
*
* @param string $name
* @param string|int $name
* @param string|null $dataClass
* @param EventDispatcherInterface $dispatcher
* @param FormFactoryInterface $factory
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/FormFactory.php
Expand Up @@ -68,7 +68,7 @@ public function createNamedBuilder($name, $type = 'Symfony\Component\Form\Extens
}

if (!\is_string($type)) {
throw new UnexpectedTypeException($type, 'string');
throw new UnexpectedTypeException($type, 'string|int');
}

$type = $this->registry->getType($type);
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/ResolvedFormType.php
Expand Up @@ -204,7 +204,7 @@ public function getOptionsResolver()
*
* Override this method if you want to customize the builder class.
*
* @param string $name The name of the builder
* @param string|int $name The name of the builder
* @param string|null $dataClass The data class
* @param FormFactoryInterface $factory The current form factory
* @param array $options The builder options
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/ResolvedFormTypeInterface.php
Expand Up @@ -52,7 +52,7 @@ public function getTypeExtensions();
* Creates a new form builder for this type.
*
* @param FormFactoryInterface $factory The form factory
* @param string $name The name for the builder
* @param string|int $name The name for the builder
* @param array $options The builder options
*
* @return FormBuilderInterface The created form builder
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/Tests/FormFactoryTest.php
Expand Up @@ -148,7 +148,7 @@ public function testCreateNamedBuilderDoesNotOverrideExistingDataOption()

/**
* @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException
* @expectedExceptionMessage Expected argument of type "string", "stdClass" given
* @expectedExceptionMessage Expected argument of type "string|int", "stdClass" given
*/
public function testCreateNamedBuilderThrowsUnderstandableException()
{
Expand Down

0 comments on commit d63bbd9

Please sign in to comment.