Skip to content

Commit

Permalink
Merge branch '5.4' into 6.0
Browse files Browse the repository at this point in the history
* 5.4:
  [Serializer] cs fix
  Cleanup more `@return` annotations
  [Form] Fix phpdoc on FormBuilderInterface
  • Loading branch information
nicolas-grekas committed Aug 17, 2021
2 parents e3ecbc0 + be4ba59 commit 1c1dce1
Show file tree
Hide file tree
Showing 54 changed files with 46 additions and 355 deletions.
4 changes: 2 additions & 2 deletions AbstractRendererEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function getResourceForBlockNameHierarchy(FormView $view, array $blockNam
/**
* {@inheritdoc}
*/
public function getResourceHierarchyLevel(FormView $view, array $blockNameHierarchy, int $hierarchyLevel): int|bool
public function getResourceHierarchyLevel(FormView $view, array $blockNameHierarchy, int $hierarchyLevel): int|false
{
$cacheKey = $view->vars[self::CACHE_KEY_VAR];
$blockName = $blockNameHierarchy[$hierarchyLevel];
Expand All @@ -132,7 +132,7 @@ public function getResourceHierarchyLevel(FormView $view, array $blockNameHierar
*
* @see getResourceForBlock()
*
* @return bool True if the resource could be loaded, false otherwise
* @return bool
*/
abstract protected function loadResourceForBlockName(string $cacheKey, FormView $view, string $blockName);

Expand Down
22 changes: 0 additions & 22 deletions Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public function __construct(FormConfigInterface $config)

/**
* Unsupported method.
*
* @return bool Always returns false
*/
public function offsetExists(mixed $offset): bool
{
Expand Down Expand Up @@ -129,8 +127,6 @@ public function get(string $name): FormInterface

/**
* Unsupported method.
*
* @return bool Always returns false
*/
public function has(string $name): bool
{
Expand Down Expand Up @@ -204,8 +200,6 @@ public function getViewData(): mixed

/**
* Unsupported method.
*
* @return array Always returns an empty array
*/
public function getExtraData(): array
{
Expand All @@ -222,8 +216,6 @@ public function getConfig(): FormConfigInterface

/**
* Returns whether the button is submitted.
*
* @return bool true if the button was submitted
*/
public function isSubmitted(): bool
{
Expand All @@ -232,8 +224,6 @@ public function isSubmitted(): bool

/**
* Returns the name by which the button is identified in forms.
*
* @return string The name of the button
*/
public function getName(): string
{
Expand All @@ -260,8 +250,6 @@ public function addError(FormError $error): static

/**
* Unsupported method.
*
* @return bool Always returns true
*/
public function isValid(): bool
{
Expand All @@ -270,8 +258,6 @@ public function isValid(): bool

/**
* Unsupported method.
*
* @return bool Always returns false
*/
public function isRequired(): bool
{
Expand All @@ -292,8 +278,6 @@ public function isDisabled(): bool

/**
* Unsupported method.
*
* @return bool Always returns true
*/
public function isEmpty(): bool
{
Expand All @@ -302,8 +286,6 @@ public function isEmpty(): bool

/**
* Unsupported method.
*
* @return bool Always returns true
*/
public function isSynchronized(): bool
{
Expand Down Expand Up @@ -394,8 +376,6 @@ public function createView(FormView $parent = null): FormView

/**
* Unsupported method.
*
* @return int Always returns 0
*/
public function count(): int
{
Expand All @@ -404,8 +384,6 @@ public function count(): int

/**
* Unsupported method.
*
* @return \EmptyIterator Always returns an empty iterator
*/
public function getIterator(): \EmptyIterator
{
Expand Down
46 changes: 0 additions & 46 deletions ButtonBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ public function remove(string $name): static

/**
* Unsupported method.
*
* @return bool Always returns false
*/
public function has(string $name): bool
{
Expand All @@ -99,8 +97,6 @@ public function has(string $name): bool

/**
* Returns the children.
*
* @return array Always returns an empty array
*/
public function all(): array
{
Expand All @@ -109,8 +105,6 @@ public function all(): array

/**
* Creates the button.
*
* @return Button The button
*/
public function getForm(): Button
{
Expand Down Expand Up @@ -437,8 +431,6 @@ public function getPropertyPath(): ?PropertyPathInterface

/**
* Unsupported method.
*
* @return bool Always returns false
*/
public function getMapped(): bool
{
Expand All @@ -447,8 +439,6 @@ public function getMapped(): bool

/**
* Unsupported method.
*
* @return bool Always returns false
*/
public function getByReference(): bool
{
Expand All @@ -457,8 +447,6 @@ public function getByReference(): bool

/**
* Unsupported method.
*
* @return bool Always returns false
*/
public function getCompound(): bool
{
Expand All @@ -467,8 +455,6 @@ public function getCompound(): bool

/**
* Returns the form type used to construct the button.
*
* @return ResolvedFormTypeInterface The button's type
*/
public function getType(): ResolvedFormTypeInterface
{
Expand All @@ -477,8 +463,6 @@ public function getType(): ResolvedFormTypeInterface

/**
* Unsupported method.
*
* @return array Always returns an empty array
*/
public function getViewTransformers(): array
{
Expand All @@ -487,8 +471,6 @@ public function getViewTransformers(): array

/**
* Unsupported method.
*
* @return array Always returns an empty array
*/
public function getModelTransformers(): array
{
Expand All @@ -505,8 +487,6 @@ public function getDataMapper(): ?DataMapperInterface

/**
* Unsupported method.
*
* @return bool Always returns false
*/
public function getRequired(): bool
{
Expand All @@ -515,8 +495,6 @@ public function getRequired(): bool

/**
* Returns whether the button is disabled.
*
* @return bool Whether the button is disabled
*/
public function getDisabled(): bool
{
Expand All @@ -525,8 +503,6 @@ public function getDisabled(): bool

/**
* Unsupported method.
*
* @return bool Always returns false
*/
public function getErrorBubbling(): bool
{
Expand All @@ -543,8 +519,6 @@ public function getEmptyData(): mixed

/**
* Returns additional attributes of the button.
*
* @return array An array of key-value combinations
*/
public function getAttributes(): array
{
Expand All @@ -553,8 +527,6 @@ public function getAttributes(): array

/**
* Returns whether the attribute with the given name exists.
*
* @return bool Whether the attribute exists
*/
public function hasAttribute(string $name): bool
{
Expand All @@ -563,8 +535,6 @@ public function hasAttribute(string $name): bool

/**
* Returns the value of the given attribute.
*
* @return mixed The attribute value
*/
public function getAttribute(string $name, mixed $default = null): mixed
{
Expand All @@ -589,8 +559,6 @@ public function getDataClass(): ?string

/**
* Unsupported method.
*
* @return bool Always returns false
*/
public function getDataLocked(): bool
{
Expand Down Expand Up @@ -637,8 +605,6 @@ public function getRequestHandler(): RequestHandlerInterface

/**
* Unsupported method.
*
* @return bool Always returns false
*/
public function getAutoInitialize(): bool
{
Expand All @@ -647,8 +613,6 @@ public function getAutoInitialize(): bool

/**
* Unsupported method.
*
* @return bool Always returns false
*/
public function getInheritData(): bool
{
Expand All @@ -657,8 +621,6 @@ public function getInheritData(): bool

/**
* Returns all options passed during the construction of the button.
*
* @return array The passed options
*/
public function getOptions(): array
{
Expand All @@ -667,8 +629,6 @@ public function getOptions(): array

/**
* Returns whether a specific option exists.
*
* @return bool Whether the option exists
*/
public function hasOption(string $name): bool
{
Expand All @@ -677,8 +637,6 @@ public function hasOption(string $name): bool

/**
* Returns the value of a specific option.
*
* @return mixed The option value
*/
public function getOption(string $name, mixed $default = null): mixed
{
Expand All @@ -697,8 +655,6 @@ public function getIsEmptyCallback(): ?callable

/**
* Unsupported method.
*
* @return int Always returns 0
*/
public function count(): int
{
Expand All @@ -707,8 +663,6 @@ public function count(): int

/**
* Unsupported method.
*
* @return \EmptyIterator Always returns an empty iterator
*/
public function getIterator(): \EmptyIterator
{
Expand Down
8 changes: 3 additions & 5 deletions ChoiceList/ChoiceListInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function getChoices(): array;
* Null and false MUST NOT conflict when being casted to string.
* For this some default incremented values SHOULD be computed.
*
* @return string[] The choice values
* @return string[]
*/
public function getValues(): array;

Expand Down Expand Up @@ -86,7 +86,7 @@ public function getValues(): array;
* this method SHOULD be equivalent to {@link getValues()}.
* The $groupBy callback parameter SHOULD be used instead.
*
* @return string[] The choice values
* @return string[]
*/
public function getStructuredValues(): array;

Expand Down Expand Up @@ -120,8 +120,6 @@ public function getOriginalKeys(): array;
*
* @param string[] $values An array of choice values. Non-existing values in
* this array are ignored
*
* @return array An array of choices
*/
public function getChoicesForValues(array $values): array;

Expand All @@ -134,7 +132,7 @@ public function getChoicesForValues(array $values): array;
* @param array $choices An array of choices. Non-existing choices in this
* array are ignored
*
* @return string[] An array of choice values
* @return string[]
*/
public function getValuesForChoices(array $choices): array;
}
2 changes: 0 additions & 2 deletions ChoiceList/Factory/CachingFactoryDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ public function __construct(ChoiceListFactoryInterface $decoratedFactory)

/**
* Returns the decorated factory.
*
* @return ChoiceListFactoryInterface The decorated factory
*/
public function getDecoratedFactory(): ChoiceListFactoryInterface
{
Expand Down
6 changes: 0 additions & 6 deletions ChoiceList/Factory/ChoiceListFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ interface ChoiceListFactoryInterface
* Null may be passed when the choice list contains the empty value.
*
* @param callable|null $filter The callable filtering the choices
*
* @return ChoiceListInterface The choice list
*/
public function createListFromChoices(iterable $choices, callable $value = null, callable $filter = null): ChoiceListInterface;

Expand All @@ -45,8 +43,6 @@ public function createListFromChoices(iterable $choices, callable $value = null,
* Null may be passed when the choice list contains the empty value.
*
* @param callable|null $filter The callable filtering the choices
*
* @return ChoiceListInterface The choice list
*/
public function createListFromLoader(ChoiceLoaderInterface $loader, callable $value = null, callable $filter = null): ChoiceListInterface;

Expand Down Expand Up @@ -81,8 +77,6 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, callable $va
* pass false to discard the label
* @param array|callable|null $attr The callable generating the HTML attributes
* @param array|callable $labelTranslationParameters The parameters used to translate the choice labels
*
* @return ChoiceListView The choice list view
*/
public function createView(ChoiceListInterface $list, array|callable $preferredChoices = null, callable|false $label = null, callable $index = null, callable $groupBy = null, array|callable $attr = null, array|callable $labelTranslationParameters = []): ChoiceListView;
}
Loading

0 comments on commit 1c1dce1

Please sign in to comment.