[Form] backport type fixes

This commit is contained in:
Nicolas Grekas 2021-07-07 11:20:57 +02:00
parent 257666378c
commit 75691c64d1
3 changed files with 12 additions and 20 deletions

View File

@ -84,10 +84,8 @@ class CachingFactoryDecorator implements ChoiceListFactoryInterface, ResetInterf
/**
* {@inheritdoc}
*
* @param callable|Cache\ChoiceValue|null $value The callable or static option for
* generating the choice values
* @param callable|Cache\ChoiceFilter|null $filter The callable or static option for
* filtering the choices
* @param mixed $value
* @param mixed $filter
*/
public function createListFromChoices(iterable $choices, $value = null/*, $filter = null*/)
{
@ -127,12 +125,8 @@ class CachingFactoryDecorator implements ChoiceListFactoryInterface, ResetInterf
/**
* {@inheritdoc}
*
* @param ChoiceLoaderInterface|Cache\ChoiceLoader $loader The loader or static loader to load
* the choices lazily
* @param callable|Cache\ChoiceValue|null $value The callable or static option for
* generating the choice values
* @param callable|Cache\ChoiceFilter|null $filter The callable or static option for
* filtering the choices
* @param mixed $value
* @param mixed $filter
*/
public function createListFromLoader(ChoiceLoaderInterface $loader, $value = null/*, $filter = null*/)
{
@ -174,11 +168,11 @@ class CachingFactoryDecorator implements ChoiceListFactoryInterface, ResetInterf
/**
* {@inheritdoc}
*
* @param array|callable|Cache\PreferredChoice|null $preferredChoices The preferred choices
* @param callable|false|Cache\ChoiceLabel|null $label The option or static option generating the choice labels
* @param callable|Cache\ChoiceFieldName|null $index The option or static option generating the view indices
* @param callable|Cache\GroupBy|null $groupBy The option or static option generating the group names
* @param array|callable|Cache\ChoiceAttr|null $attr The option or static option generating the HTML attributes
* @param mixed $preferredChoices
* @param mixed $label
* @param mixed $index
* @param mixed $groupBy
* @param mixed $attr
*/
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, $index = null, $groupBy = null, $attr = null)
{

View File

@ -18,6 +18,7 @@ use Symfony\Component\PropertyAccess\Exception\AccessException as PropertyAccess
use Symfony\Component\PropertyAccess\Exception\UninitializedPropertyException;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\PropertyAccess\PropertyPathInterface;
/**
* Writes and reads values to/from an object or array using property path.
@ -84,7 +85,7 @@ class PropertyPathAccessor implements DataAccessorInterface
return null !== $form->getPropertyPath();
}
private function getPropertyValue($data, $propertyPath)
private function getPropertyValue($data, PropertyPathInterface $propertyPath)
{
try {
return $this->propertyAccessor->getValue($data, $propertyPath);

View File

@ -15,10 +15,7 @@ trait VersionAwareTest
{
protected static $supportedFeatureSetVersion = 404;
/**
* @param int $requiredFeatureSetVersion
*/
protected function requiresFeatureSet($requiredFeatureSetVersion)
protected function requiresFeatureSet(int $requiredFeatureSetVersion)
{
if ($requiredFeatureSetVersion > static::$supportedFeatureSetVersion) {
$this->markTestSkipped(sprintf('Test requires features from symfony/form %.2f but only version %.2f is supported.', $requiredFeatureSetVersion / 100, static::$supportedFeatureSetVersion / 100));