diff --git a/Classes/Form/AbstractInlineFormField.php b/Classes/Form/AbstractInlineFormField.php index 2309ff118..fa5943878 100644 --- a/Classes/Form/AbstractInlineFormField.php +++ b/Classes/Form/AbstractInlineFormField.php @@ -11,95 +11,70 @@ use FluidTYPO3\Flux\Enum\InlineFieldControls; use FluidTYPO3\Flux\Enum\InlineFieldNewRecordButtonPosition; -/** - * AbstractInlineFormField - */ abstract class AbstractInlineFormField extends AbstractRelationFormField implements InlineRelationFieldInterface { /** * If true, all child records are shown as collapsed. - * - * @var boolean */ - protected $collapseAll = false; + protected bool $collapseAll = false; /** * Show only one expanded record at any time. If a new record is expanded, * all others are collapsed. - * - * @var boolean */ - protected $expandSingle = false; + protected bool $expandSingle = false; /** * Add the foreign table's title to the 'Add new' link (ie. 'Add new (sometable)') - * - * @var boolean */ - protected $newRecordLinkAddTitle = false; + protected bool $newRecordLinkAddTitle = false; /** * Record link position - can be either \FluidTYPO3\Flux\Form::POSITION_TOP, * \FluidTYPO3\Flux\Form::POSITION_BOTTOM, \FluidTYPO3\Flux\Form::POSITION_BOTH or * \FluidTYPO3\Flux\Form::POSITION_NONE. - * - * @var string */ - protected $newRecordLinkPosition = InlineFieldNewRecordButtonPosition::TOP; + protected string $newRecordLinkPosition = InlineFieldNewRecordButtonPosition::TOP; /** * For use on bidirectional relations using an intermediary table. * In combinations, it's possible to edit attributes and the related child record. - * - * @var boolean */ - protected $useCombination = false; + protected bool $useCombination = false; /** * Allow manual sorting of child objects. - * - * @var boolean */ - protected $useSortable = false; + protected bool $useSortable = false; /** * Show unlocalized records which are in the original language, but not yet localized. - * - * @var boolean */ - protected $showPossibleLocalizationRecords = false; + protected bool $showPossibleLocalizationRecords = false; /** * Show records which were once localized but do not exist in the original * language anymore. - * - * @var boolean */ - protected $showRemovedLocalizationRecords = false; + protected bool $showRemovedLocalizationRecords = false; /** * Defines whether to show the 'localize all records' link to fetch untranslated * records from the original language. - * - * @var boolean */ - protected $showAllLocalizationLink = false; + protected bool $showAllLocalizationLink = false; /** * Defines whether to show a 'synchronize' link to update to a 1:1 translation with * the original language. - * - * @var boolean */ - protected $showSynchronizationLink = false; + protected bool $showSynchronizationLink = false; /** * Associative array with the keys 'info', 'new', 'dragdrop', 'sort', 'hide', delete' * and 'localize'. Set either one to TRUE or FALSE to show or hide it. - * - * @var array */ - protected $enabledControls = [ + protected array $enabledControls = [ InlineFieldControls::INFO => false, InlineFieldControls::NEW => true, InlineFieldControls::DRAGDROP => true, @@ -112,30 +87,12 @@ abstract class AbstractInlineFormField extends AbstractRelationFormField impleme /** * Array of field=>value pairs which are always used in conditions as well as inserted into new * records created through this form component. - * - * @var array - */ - protected $foreignMatchFields = []; - - /** - * @var array - */ - protected $headerThumbnail = null; - - /** - * @var string - */ - protected $levelLinksPosition = null; - - /** - * @var array */ - protected $overrideChildTca; - - /** - * @var array - */ - protected $foreignTypes = null; + protected array $foreignMatchFields = []; + protected ?array $headerThumbnail = null; + protected ?string $levelLinksPosition = null; + protected array $overrideChildTca = []; + protected array $foreignTypes = []; public function prepareConfiguration(string $type): array { @@ -165,290 +122,178 @@ public function prepareConfiguration(string $type): array return $configuration; } - /** - * @param boolean $collapseAll - * @return AbstractInlineFormField - */ - public function setCollapseAll($collapseAll) + public function setCollapseAll(bool $collapseAll): self { $this->collapseAll = $collapseAll; return $this; } - /** - * @return boolean - */ - public function getCollapseAll() + public function getCollapseAll(): bool { return $this->collapseAll; } - /** - * @param array $enabledControls - * @return AbstractInlineFormField - */ - public function setEnabledControls(array $enabledControls) + public function setEnabledControls(array $enabledControls): self { $this->enabledControls = $enabledControls; return $this; } - /** - * @return array - */ - public function getEnabledControls() + public function getEnabledControls(): array { return $this->enabledControls; } - /** - * @param boolean $expandSingle - * @return AbstractInlineFormField - */ - public function setExpandSingle($expandSingle) + public function setExpandSingle(bool $expandSingle): self { $this->expandSingle = $expandSingle; return $this; } - /** - * @return boolean - */ - public function getExpandSingle() + public function getExpandSingle(): bool { return $this->expandSingle; } - /** - * @param boolean $newRecordLinkAddTitle - * @return AbstractInlineFormField - */ - public function setNewRecordLinkAddTitle($newRecordLinkAddTitle) + public function setNewRecordLinkAddTitle(bool $newRecordLinkAddTitle): self { $this->newRecordLinkAddTitle = $newRecordLinkAddTitle; return $this; } - /** - * @return boolean - */ - public function getNewRecordLinkAddTitle() + public function getNewRecordLinkAddTitle(): bool { return $this->newRecordLinkAddTitle; } - /** - * @param string $newRecordLinkPosition - * @return AbstractInlineFormField - */ - public function setNewRecordLinkPosition($newRecordLinkPosition) + public function setNewRecordLinkPosition(string $newRecordLinkPosition): self { $this->newRecordLinkPosition = $newRecordLinkPosition; return $this; } - /** - * @return string - */ - public function getNewRecordLinkPosition() + public function getNewRecordLinkPosition(): string { return $this->newRecordLinkPosition; } - /** - * @param boolean $showAllLocalizationLink - * @return AbstractInlineFormField - */ - public function setShowAllLocalizationLink($showAllLocalizationLink) + public function setShowAllLocalizationLink(bool $showAllLocalizationLink): self { $this->showAllLocalizationLink = $showAllLocalizationLink; return $this; } - /** - * @return boolean - */ - public function getShowAllLocalizationLink() + public function getShowAllLocalizationLink(): bool { return $this->showAllLocalizationLink; } - /** - * @param boolean $showPossibleLocalizationRecords - * @return AbstractInlineFormField - */ - public function setShowPossibleLocalizationRecords($showPossibleLocalizationRecords) + public function setShowPossibleLocalizationRecords(bool $showPossibleLocalizationRecords): self { $this->showPossibleLocalizationRecords = $showPossibleLocalizationRecords; return $this; } - /** - * @return boolean - */ - public function getShowPossibleLocalizationRecords() + public function getShowPossibleLocalizationRecords(): bool { return $this->showPossibleLocalizationRecords; } - /** - * @param boolean $showRemovedLocalizationRecords - * @return AbstractInlineFormField - */ - public function setShowRemovedLocalizationRecords($showRemovedLocalizationRecords) + public function setShowRemovedLocalizationRecords(bool $showRemovedLocalizationRecords): self { $this->showRemovedLocalizationRecords = $showRemovedLocalizationRecords; return $this; } - /** - * @return boolean - */ - public function getShowRemovedLocalizationRecords() + public function getShowRemovedLocalizationRecords(): bool { return $this->showRemovedLocalizationRecords; } - /** - * @param boolean $showSynchronizationLink - * @return AbstractInlineFormField - */ - public function setShowSynchronizationLink($showSynchronizationLink) + public function setShowSynchronizationLink(bool $showSynchronizationLink): self { $this->showSynchronizationLink = $showSynchronizationLink; return $this; } - /** - * @return boolean - */ - public function getShowSynchronizationLink() + public function getShowSynchronizationLink(): bool { return $this->showSynchronizationLink; } - /** - * @param boolean $useCombination - * @return AbstractInlineFormField - */ - public function setUseCombination($useCombination) + public function setUseCombination(bool $useCombination): self { $this->useCombination = $useCombination; return $this; } - /** - * @return boolean - */ - public function getUseCombination() + public function getUseCombination(): bool { return $this->useCombination; } - /** - * @param boolean $useSortable - * @return AbstractInlineFormField - */ - public function setUseSortable($useSortable) + public function setUseSortable(bool $useSortable): self { $this->useSortable = $useSortable; return $this; } - /** - * @return boolean - */ - public function getUseSortable() + public function getUseSortable(): bool { return $this->useSortable; } - /** - * @param array $foreignMatchFields - * @return AbstractInlineFormField - */ - public function setForeignMatchFields(array $foreignMatchFields) + public function setForeignMatchFields(array $foreignMatchFields): self { $this->foreignMatchFields = $foreignMatchFields; return $this; } - /** - * @return array - */ - public function getForeignMatchFields() + public function getForeignMatchFields(): array { return $this->foreignMatchFields; } - /** - * @param array $headerThumbnail - * @return AbstractInlineFormField - */ - public function setHeaderThumbnail(array $headerThumbnail) + public function setHeaderThumbnail(array $headerThumbnail): self { $this->headerThumbnail = $headerThumbnail; return $this; } - /** - * @return array - */ - public function getHeaderThumbnail() + public function getHeaderThumbnail(): ?array { return $this->headerThumbnail; } - /** - * @param string $levelLinksPosition - * @return AbstractInlineFormField - */ - public function setLevelLinksPosition($levelLinksPosition) + public function setLevelLinksPosition(?string $levelLinksPosition): self { $this->levelLinksPosition = $levelLinksPosition; return $this; } - /** - * @return string|null - */ - public function getLevelLinksPosition() + public function getLevelLinksPosition(): ?string { return $this->levelLinksPosition; } - /** - * @param array $overrideChildTca - * @return RelationFieldInterface - */ - public function setOverrideChildTca($overrideChildTca) + public function setOverrideChildTca(array $overrideChildTca): self { $this->overrideChildTca = $overrideChildTca; return $this; } - /** - * @return array - */ - public function getOverrideChildTca() + public function getOverrideChildTca():array { return $this->overrideChildTca; } - /** - * @param array|null $foreignTypes - * @return RelationFieldInterface - */ - public function setForeignTypes($foreignTypes) + public function setForeignTypes(array $foreignTypes): self { - $this->foreignTypes = $foreignTypes ?? []; + $this->foreignTypes = $foreignTypes; return $this; } - /** - * @return array - */ - public function getForeignTypes() + public function getForeignTypes(): array { return $this->foreignTypes; } diff --git a/Classes/Form/AbstractMultiValueFormField.php b/Classes/Form/AbstractMultiValueFormField.php index 5ced65b7d..6268a46a4 100644 --- a/Classes/Form/AbstractMultiValueFormField.php +++ b/Classes/Form/AbstractMultiValueFormField.php @@ -14,9 +14,6 @@ use TYPO3\CMS\Extbase\Persistence\QueryInterface; use TYPO3\CMS\Extbase\Reflection\ObjectAccess; -/** - * AbstractMultiValueFormField - */ abstract class AbstractMultiValueFormField extends AbstractFormField implements MultiValueFieldInterface { protected int $size = 1; diff --git a/Classes/Form/AbstractRelationFormField.php b/Classes/Form/AbstractRelationFormField.php index ab322122a..eb644baa9 100644 --- a/Classes/Form/AbstractRelationFormField.php +++ b/Classes/Form/AbstractRelationFormField.php @@ -13,31 +13,20 @@ */ abstract class AbstractRelationFormField extends AbstractMultiValueFormField implements RelationFieldInterface { - /** - * @var string - */ - protected $table; - - /** - * @var string - */ - protected $condition; + protected string $table = ''; + protected ?string $condition = null; /** * Optional filter - as an [$userFunctionReferenceString, $parameters) * - to further condition which records are allowed to be selected in this field. - * - * @var array */ - protected $filter = []; + protected array $filter = []; /** * The foreign_field is the field of the child record pointing to the * parent record. This defines where to store the uid of the parent record. - * - * @var string */ - protected $foreignField; + protected ?string $foreignField = null; /** * The field of the child record pointing to the parent record. This defines @@ -45,15 +34,9 @@ abstract class AbstractRelationFormField extends AbstractMultiValueFormField imp * configuration key together with foreign_field, the child record knows what * its parent record is – so the child record could also be used on other * parent tables. - * - * @var string - */ - protected $foreignTableField; - - /** - * @var string|NULL */ - protected $manyToMany = null; + protected ?string $foreignTableField = null; + protected ?string $manyToMany = null; /** * When using many-to-many mode you can specify an array of field=>value pairs @@ -61,15 +44,13 @@ abstract class AbstractRelationFormField extends AbstractMultiValueFormField imp * * @var array */ - protected $matchFields = []; + protected array $matchFields = []; /** * If set, it overrides the label set in TCA[foreign_table]['ctrl']['label'] * for the foreign table view. - * - * @var string */ - protected $foreignLabel; + protected ?string $foreignLabel = null; /** * A selector is used to show all possible child records that could be used @@ -78,83 +59,57 @@ abstract class AbstractRelationFormField extends AbstractMultiValueFormField imp * is created. The foreign_selector points to a field of the foreign_table that * is responsible for providing a selector-box – this field on the foreign_table * usually has the type "select" and also has a "foreign_table" defined. - * - * @var string */ - protected $foreignSelector; + protected ?string $foreignSelector = null; /** * Defines a field on the child record (or on the intermediate table) that * stores the manual sorting information. - * - * @var string */ - protected $foreignSortby; + protected ?string $foreignSortby = null; /** * If a fieldname for foreign_sortby is defined, then this is ignored. Otherwise * this is used as the "ORDER BY" statement to sort the records in the table * when listed. - * - * @var string */ - protected $foreignDefaultSortby; + protected ?string $foreignDefaultSortby = null; /** * Field which must be uniue for all children of a parent record. - * - * @var string */ - protected $foreignUnique; + protected ?string $foreignUnique = null; /** * In case of bidirectional symmetric relations, this defines the field name on * the foreign table which contains the UID of this side of the relation. - * - * @var string */ - protected $symmetricField; + protected ?string $symmetricField = null; /** * If set, this overrides the default label of the selected symmetric table. - * - * @var string */ - protected $symmetricLabel; + protected ?string $symmetricLabel = null; /** * This works like foreign_sortby, but defines the field on foreign_table where * the "other" sort order is stored (this order is then used only in the reverse * symmetric relation). - * - * @var string */ - protected $symmetricSortby; + protected ?string $symmetricSortby = null; /** * Set whether children can be localizable ('select') or just inherit from * default language ('keep'). Default is empty, meaning no particular behavior. - * - * @var string */ - protected $localizationMode; + protected ?string $localizationMode = null; /** * Disables that child records get moved along with their parent records. - * - * @var boolean - */ - protected $disableMovingChildrenWithParent = false; - - /** - * @var boolean - */ - protected $showThumbnails = false; - - /** - * @var string */ - protected $oppositeField; + protected bool $disableMovingChildrenWithParent = false; + protected bool $showThumbnails = false; + protected ?string $oppositeField = null; public function prepareConfiguration(string $type): array { @@ -182,344 +137,211 @@ public function prepareConfiguration(string $type): array return $configuration; } - /** - * @param string $condition - * @return RelationFieldInterface - */ - public function setCondition($condition) + public function setCondition(?string $condition): self { $this->condition = $condition; return $this; } - /** - * @return string - */ - public function getCondition() + public function getCondition(): ?string { return $this->condition; } - /** - * @param array $filter - * @return RelationFieldInterface - */ - public function setFilter(array $filter) + public function setFilter(array $filter): self { $this->filter = $filter; return $this; } - /** - * @return array - */ - public function getFilter() + public function getFilter(): array { return $this->filter; } - /** - * @param string $foreignField - * @return RelationFieldInterface - */ - public function setForeignField($foreignField) + public function setForeignField(?string $foreignField): self { $this->foreignField = $foreignField; return $this; } - /** - * @return string - */ - public function getForeignField() + public function getForeignField(): ?string { return $this->foreignField; } - /** - * @param NULL|string $manyToMany - * @return RelationFieldInterface - */ - public function setManyToMany($manyToMany) + public function setManyToMany(?string $manyToMany): self { $this->manyToMany = $manyToMany; return $this; } - /** - * @return NULL|string - */ - public function getManyToMany() + public function getManyToMany(): ?string { return $this->manyToMany; } - /** - * @return array - */ - public function getMatchFields() + public function getMatchFields(): array { return $this->matchFields; } - /** - * @param array $matchFields - * @return RelationFieldInterface - */ - public function setMatchFields(array $matchFields) + public function setMatchFields(array $matchFields): self { $this->matchFields = $matchFields; return $this; } - /** - * @return string - */ - public function getOppositeField() + public function getOppositeField(): ?string { return $this->oppositeField; } - /** - * @param string $oppositeField - * @return RelationFieldInterface - */ - public function setOppositeField($oppositeField) + public function setOppositeField(?string $oppositeField): self { $this->oppositeField = $oppositeField; return $this; } - /** - * @param string $table - * @return RelationFieldInterface - */ - public function setTable($table) + public function setTable(string $table): self { $this->table = $table; return $this; } - /** - * @return string - */ - public function getTable() + public function getTable(): string { return $this->table; } - /** - * @param boolean $disableMovingChildrenWithParent - * @return RelationFieldInterface - */ - public function setDisableMovingChildrenWithParent($disableMovingChildrenWithParent) + public function setDisableMovingChildrenWithParent(bool $disableMovingChildrenWithParent): self { $this->disableMovingChildrenWithParent = $disableMovingChildrenWithParent; return $this; } - /** - * @return boolean - */ - public function getDisableMovingChildrenWithParent() + public function getDisableMovingChildrenWithParent(): bool { return $this->disableMovingChildrenWithParent; } - /** - * @param string $foreignDefaultSortby - * @return RelationFieldInterface - */ - public function setForeignDefaultSortby($foreignDefaultSortby) + public function setForeignDefaultSortby(?string $foreignDefaultSortby): self { $this->foreignDefaultSortby = $foreignDefaultSortby; return $this; } - /** - * @return string - */ - public function getForeignDefaultSortby() + public function getForeignDefaultSortby(): ?string { return $this->foreignDefaultSortby; } - /** - * @param string $foreignLabel - * @return RelationFieldInterface - */ - public function setForeignLabel($foreignLabel) + public function setForeignLabel(?string $foreignLabel): self { $this->foreignLabel = $foreignLabel; return $this; } - /** - * @return string - */ - public function getForeignLabel() + public function getForeignLabel(): ?string { return $this->foreignLabel; } - /** - * @param string $foreignSelector - * @return RelationFieldInterface - */ - public function setForeignSelector($foreignSelector) + public function setForeignSelector(?string $foreignSelector): self { $this->foreignSelector = $foreignSelector; return $this; } - /** - * @return string - */ - public function getForeignSelector() + public function getForeignSelector(): ?string { return $this->foreignSelector; } - /** - * @param string $foreignSortby - * @return RelationFieldInterface - */ - public function setForeignSortby($foreignSortby) + public function setForeignSortby(?string $foreignSortby): self { $this->foreignSortby = $foreignSortby; return $this; } - /** - * @return string - */ - public function getForeignSortby() + public function getForeignSortby(): ?string { return $this->foreignSortby; } - /** - * @param string $foreignTableField - * @return RelationFieldInterface - */ - public function setForeignTableField($foreignTableField) + public function setForeignTableField(?string $foreignTableField): self { $this->foreignTableField = $foreignTableField; return $this; } - /** - * @return string - */ - public function getForeignTableField() + public function getForeignTableField(): ?string { return $this->foreignTableField; } - /** - * @param string $foreignUnique - * @return RelationFieldInterface - */ - public function setForeignUnique($foreignUnique) + public function setForeignUnique(?string $foreignUnique): self { $this->foreignUnique = $foreignUnique; return $this; } - /** - * @return string - */ - public function getForeignUnique() + public function getForeignUnique(): ?string { return $this->foreignUnique; } - /** - * @param string $localizationMode - * @return RelationFieldInterface - */ - public function setLocalizationMode($localizationMode) + public function setLocalizationMode(?string $localizationMode): self { $this->localizationMode = $localizationMode; return $this; } - /** - * @return string - */ - public function getLocalizationMode() + public function getLocalizationMode(): ?string { return $this->localizationMode; } - /** - * @param string $symmetricField - * @return RelationFieldInterface - */ - public function setSymmetricField($symmetricField) + public function setSymmetricField(?string $symmetricField): self { $this->symmetricField = $symmetricField; return $this; } - /** - * @return string - */ - public function getSymmetricField() + public function getSymmetricField(): ?string { return $this->symmetricField; } - /** - * @param string $symmetricLabel - * @return RelationFieldInterface - */ - public function setSymmetricLabel($symmetricLabel) + public function setSymmetricLabel(?string $symmetricLabel): self { $this->symmetricLabel = $symmetricLabel; return $this; } - /** - * @return string - */ - public function getSymmetricLabel() + public function getSymmetricLabel(): ?string { return $this->symmetricLabel; } - /** - * @param string $symmetricSortby - * @return RelationFieldInterface - */ - public function setSymmetricSortby($symmetricSortby) + public function setSymmetricSortby(?string $symmetricSortby): self { $this->symmetricSortby = $symmetricSortby; return $this; } - /** - * @return string - */ - public function getSymmetricSortby() + public function getSymmetricSortby(): ?string { return $this->symmetricSortby; } - /** - * @param boolean $showThumbnails - * @return RelationFieldInterface - */ - public function setShowThumbnails($showThumbnails) + public function setShowThumbnails(bool $showThumbnails): self { $this->showThumbnails = $showThumbnails; return $this; } - /** - * @return boolean - */ - public function getShowThumbnails() + public function getShowThumbnails(): bool { return $this->showThumbnails; } diff --git a/Classes/Form/Field.php b/Classes/Form/Field.php index a39f70628..e5321351f 100644 --- a/Classes/Form/Field.php +++ b/Classes/Form/Field.php @@ -8,20 +8,9 @@ */ class Field extends AbstractFormField { - /** - * @var string - */ - protected $type = 'input'; - - /** - * @var string|null - */ - protected $displayCond; - - /** - * @var string|null - */ - protected $onChange; + protected string $type = 'input'; + protected ?string $displayCond = null; + protected ?string $onChange = null; public function buildConfiguration(): array { diff --git a/Classes/Form/Field/Inline/Fal.php b/Classes/Form/Field/Inline/Fal.php index 5e7d0025d..ba4b054df 100644 --- a/Classes/Form/Field/Inline/Fal.php +++ b/Classes/Form/Field/Inline/Fal.php @@ -26,18 +26,13 @@ class Fal extends AbstractInlineFormField const DEFAULT_NEW_RECORD_LINK_ADD_TITLE = true; const DEFAULT_CREATE_NEW_RELATION_LINK_TITLE = 'LLL:EXT:lang/locallang_core.xlf:cm.createNewRelation'; - /** - * @var string - */ - protected $table = self::DEFAULT_TABLE; + protected string $table = self::DEFAULT_TABLE; /** * The foreign_field is the field of the child record pointing to the * parent record. This defines where to store the uid of the parent record. - * - * @var string */ - protected $foreignField = self::DEFAULT_FOREIGN_FIELD; + protected ?string $foreignField = self::DEFAULT_FOREIGN_FIELD; /** * The field of the child record pointing to the parent record. This defines @@ -45,18 +40,14 @@ class Fal extends AbstractInlineFormField * configuration key together with foreign_field, the child record knows what * its parent record is – so the child record could also be used on other * parent tables. - * - * @var string */ - protected $foreignTableField = self::DEFAULT_FOREIGN_TABLE_FIELD; + protected ?string $foreignTableField = self::DEFAULT_FOREIGN_TABLE_FIELD; /** * If set, it overrides the label set in TCA[foreign_table]['ctrl']['label'] * for the foreign table view. - * - * @var string */ - protected $foreignLabel = self::DEFAULT_FOREIGN_LABEL; + protected ?string $foreignLabel = self::DEFAULT_FOREIGN_LABEL; /** * A selector is used to show all possible child records that could be used @@ -65,33 +56,25 @@ class Fal extends AbstractInlineFormField * is created. The foreign_selector points to a field of the foreign_table that * is responsible for providing a selector-box – this field on the foreign_table * usually has the type "select" and also has a "foreign_table" defined. - * - * @var string */ - protected $foreignSelector = self::DEFAULT_FOREIGN_SELECTOR; + protected ?string $foreignSelector = self::DEFAULT_FOREIGN_SELECTOR; /** * Defines a field on the child record (or on the intermediate table) that * stores the manual sorting information. - * - * @var string */ - protected $foreignSortby = self::DEFAULT_FOREIGN_SORTBY; + protected ?string $foreignSortby = self::DEFAULT_FOREIGN_SORTBY; /** * Allow manual sorting of child objects. - * - * @var boolean */ - protected $useSortable = self::DEFAULT_USE_SORTABLE; + protected bool $useSortable = self::DEFAULT_USE_SORTABLE; /** * Associative array with the keys 'info', 'new', 'dragdrop', 'sort', 'hide', delete' * and 'localize'. Set either one to TRUE or FALSE to show or hide it. - * - * @var array */ - protected $enabledControls = [ + protected array $enabledControls = [ InlineFieldControls::INFO => false, InlineFieldControls::NEW => false, InlineFieldControls::DRAGDROP => true, @@ -101,48 +84,34 @@ class Fal extends AbstractInlineFormField InlineFieldControls::LOCALIZE => true, ]; - /** - * @var array - */ - protected $headerThumbnail = [ + protected ?array $headerThumbnail = [ 'field' => 'uid_local', 'width' => '64', 'height' => '64', ]; - /** - * @var string - */ - protected $levelLinksPosition = self::DEFAULT_LEVEL_LINKS_POSITION; + protected ?string $levelLinksPosition = self::DEFAULT_LEVEL_LINKS_POSITION; /** * Set whether children can be localizable ('select') or just inherit from * default language ('keep'). Default is empty, meaning no particular behavior. - * - * @var string */ - protected $localizationMode = self::DEFAULT_LOCALIZATION_MODE; + protected ?string $localizationMode = self::DEFAULT_LOCALIZATION_MODE; /** * Add the foreign table's title to the 'Add new' link (ie. 'Add new (sometable)') - * - * @var boolean */ - protected $newRecordLinkAddTitle = self::DEFAULT_NEW_RECORD_LINK_ADD_TITLE; + protected bool $newRecordLinkAddTitle = self::DEFAULT_NEW_RECORD_LINK_ADD_TITLE; /** * Label of 'create new relation' button - * - * @var string */ - protected $createNewRelationLinkTitle = self::DEFAULT_CREATE_NEW_RELATION_LINK_TITLE; + protected ?string $createNewRelationLinkTitle = self::DEFAULT_CREATE_NEW_RELATION_LINK_TITLE; /** * Crop variants for uploaded images - * - * @var array */ - protected $cropVariants = []; + protected array $cropVariants = []; protected ?string $renderType = null; @@ -167,37 +136,23 @@ public function buildConfiguration(): array return $configuration; } - /** - * @return string - */ - public function getCreateNewRelationLinkTitle() + public function getCreateNewRelationLinkTitle(): ?string { return $this->createNewRelationLinkTitle; } - /** - * @param string $createNewRelationLinkTitle - * @return Fal - */ - public function setCreateNewRelationLinkTitle($createNewRelationLinkTitle) + public function setCreateNewRelationLinkTitle(string $createNewRelationLinkTitle): self { $this->createNewRelationLinkTitle = $createNewRelationLinkTitle; return $this; } - /** - * @return array - */ - public function getCropVariants() + public function getCropVariants(): array { return $this->cropVariants; } - /** - * @param array $cropVariants - * @return Fal - */ - public function setCropVariants(array $cropVariants) + public function setCropVariants(array $cropVariants): self { $this->cropVariants = $cropVariants; return $this; diff --git a/Classes/Form/FieldContainerInterface.php b/Classes/Form/FieldContainerInterface.php index 48faa1e0a..ac6fce630 100644 --- a/Classes/Form/FieldContainerInterface.php +++ b/Classes/Form/FieldContainerInterface.php @@ -8,14 +8,10 @@ * LICENSE.md file that was distributed with this source code. */ -/** - * FieldContainerInterface - */ interface FieldContainerInterface extends ContainerInterface { - /** * @return FieldInterface[] */ - public function getFields(); + public function getFields(): iterable; } diff --git a/Classes/Form/FieldInterface.php b/Classes/Form/FieldInterface.php index 555d13df8..2ffa01adb 100644 --- a/Classes/Form/FieldInterface.php +++ b/Classes/Form/FieldInterface.php @@ -8,9 +8,6 @@ * LICENSE.md file that was distributed with this source code. */ -/** - * FieldInterface - */ interface FieldInterface extends FormInterface { public function buildConfiguration(): array; diff --git a/Classes/Form/FormInterface.php b/Classes/Form/FormInterface.php index 1744744e5..95342988d 100644 --- a/Classes/Form/FormInterface.php +++ b/Classes/Form/FormInterface.php @@ -8,9 +8,6 @@ * LICENSE.md file that was distributed with this source code. */ -/** - * FormInterface - */ interface FormInterface { public function build(): array; diff --git a/Classes/Form/InlineRelationFieldInterface.php b/Classes/Form/InlineRelationFieldInterface.php index 39c7fb471..c2778d0a8 100644 --- a/Classes/Form/InlineRelationFieldInterface.php +++ b/Classes/Form/InlineRelationFieldInterface.php @@ -8,151 +8,32 @@ * LICENSE.md file that was distributed with this source code. */ -/** - * InlineRelationFieldInterface - */ interface InlineRelationFieldInterface extends RelationFieldInterface { - - /** - * @param mixed $foreignTypes - * @return InlineRelationFieldInterface - */ - public function setForeignTypes($foreignTypes); - - /** - * @return array - */ - public function getForeignTypes(); - - /** - * @param boolean $collapseAll - * @return InlineRelationFieldInterface - */ - public function setCollapseAll($collapseAll); - - /** - * @return boolean - */ - public function getCollapseAll(); - - /** - * @param array $enabledControls - * @return InlineRelationFieldInterface - */ - public function setEnabledControls(array $enabledControls); - - /** - * @return array - */ - public function getEnabledControls(); - - /** - * @param boolean $expandSingle - * @return InlineRelationFieldInterface - */ - public function setExpandSingle($expandSingle); - - /** - * @return boolean - */ - public function getExpandSingle(); - - /** - * @param boolean $newRecordLinkAddTitle - * @return InlineRelationFieldInterface - */ - public function setNewRecordLinkAddTitle($newRecordLinkAddTitle); - - /** - * @return boolean - */ - public function getNewRecordLinkAddTitle(); - - /** - * @param string $newRecordLinkPosition - * @return InlineRelationFieldInterface - */ - public function setNewRecordLinkPosition($newRecordLinkPosition); - - /** - * @return string - */ - public function getNewRecordLinkPosition(); - - /** - * @param boolean $showAllLocalizationLink - * @return InlineRelationFieldInterface - */ - public function setShowAllLocalizationLink($showAllLocalizationLink); - - /** - * @return boolean - */ - public function getShowAllLocalizationLink(); - - /** - * @param boolean $showPossibleLocalizationRecords - * @return InlineRelationFieldInterface - */ - public function setShowPossibleLocalizationRecords($showPossibleLocalizationRecords); - - /** - * @return boolean - */ - public function getShowPossibleLocalizationRecords(); - - /** - * @param boolean $showRemovedLocalizationRecords - * @return InlineRelationFieldInterface - */ - public function setShowRemovedLocalizationRecords($showRemovedLocalizationRecords); - - /** - * @return boolean - */ - public function getShowRemovedLocalizationRecords(); - - /** - * @param boolean $showSynchronizationLink - * @return InlineRelationFieldInterface - */ - public function setShowSynchronizationLink($showSynchronizationLink); - - /** - * @return boolean - */ - public function getShowSynchronizationLink(); - - /** - * @param boolean $useCombination - * @return InlineRelationFieldInterface - */ - public function setUseCombination($useCombination); - - /** - * @return boolean - */ - public function getUseCombination(); - - /** - * @param boolean $useSortable - * @return InlineRelationFieldInterface - */ - public function setUseSortable($useSortable); - /** - * @return boolean - */ - public function getUseSortable(); - - /** - * @param array $foreignMatchFields - * @return InlineRelationFieldInterface - */ - public function setForeignMatchFields(array $foreignMatchFields); - - /** - * @return array - */ - public function getForeignMatchFields(); + public function setForeignTypes(array $foreignTypes): self; + public function getForeignTypes(): array; + public function setCollapseAll(bool $collapseAll): self; + public function getCollapseAll(): bool; + public function setEnabledControls(array $enabledControls): self; + public function getEnabledControls(): array; + public function setExpandSingle(bool $expandSingle): self; + public function getExpandSingle(): bool; + public function setNewRecordLinkAddTitle(bool $newRecordLinkAddTitle): self; + public function getNewRecordLinkAddTitle(): bool; + public function setNewRecordLinkPosition(string $newRecordLinkPosition): self; + public function getNewRecordLinkPosition(): string; + public function setShowAllLocalizationLink(bool $showAllLocalizationLink): self; + public function getShowAllLocalizationLink(): bool; + public function setShowPossibleLocalizationRecords(bool $showPossibleLocalizationRecords): self; + public function getShowPossibleLocalizationRecords(): bool; + public function setShowRemovedLocalizationRecords(bool $showRemovedLocalizationRecords): self; + public function getShowRemovedLocalizationRecords(): bool; + public function setShowSynchronizationLink(bool $showSynchronizationLink): self; + public function getShowSynchronizationLink(): bool; + public function setUseCombination(bool $useCombination): self; + public function getUseCombination(): bool; + public function setUseSortable(bool $useSortable): self; + public function getUseSortable(): bool; + public function setForeignMatchFields(array $foreignMatchFields): self; + public function getForeignMatchFields(): array; } diff --git a/Classes/Form/MultiValueFieldInterface.php b/Classes/Form/MultiValueFieldInterface.php index f7258fbe3..29c46c652 100644 --- a/Classes/Form/MultiValueFieldInterface.php +++ b/Classes/Form/MultiValueFieldInterface.php @@ -8,9 +8,6 @@ * LICENSE.md file that was distributed with this source code. */ -/** - * MultiValueFieldInterface - */ interface MultiValueFieldInterface extends FieldInterface { public function setSize(int $size): self; @@ -25,4 +22,14 @@ public function setItemListStyle(?string $itemListStyle): self; public function getItemListStyle(): ?string; public function setSelectedListStyle(?string $selectedListStyle): self; public function getSelectedListStyle(): ?string; + + /** + * @param boolean|string $emptyOption + */ + public function setEmptyOption($emptyOption): self; + + /** + * @return boolean|string + */ + public function getEmptyOption(); } diff --git a/Classes/Form/RelationFieldInterface.php b/Classes/Form/RelationFieldInterface.php index 4fe388174..30f87bb8c 100644 --- a/Classes/Form/RelationFieldInterface.php +++ b/Classes/Form/RelationFieldInterface.php @@ -8,218 +8,42 @@ * LICENSE.md file that was distributed with this source code. */ -/** - * Public contract for relation-capable fields - */ interface RelationFieldInterface extends MultiValueFieldInterface { - - /** - * @param string $condition - * @return RelationFieldInterface - */ - public function setCondition($condition); - - /** - * @return string - */ - public function getCondition(); - - /** - * @param string $foreignField - * @return RelationFieldInterface - */ - public function setForeignField($foreignField); - - /** - * @return string - */ - public function getForeignField(); - - /** - * @param NULL|string $manyToMany - * @return RelationFieldInterface - */ - public function setManyToMany($manyToMany); - - /** - * @return NULL|string - */ - public function getManyToMany(); - - /** - * @return array - */ - public function getMatchFields(); - - /** - * @param array $matchFields - * @return RelationFieldInterface - */ - public function setMatchFields(array $matchFields); - - /** - * @param string $table - * @return RelationFieldInterface - */ - public function setTable($table); - - /** - * @return string - */ - public function getTable(); - - /** - * @param boolean $disableMovingChildrenWithParent - * @return RelationFieldInterface - */ - public function setDisableMovingChildrenWithParent($disableMovingChildrenWithParent); - - /** - * @return boolean - */ - public function getDisableMovingChildrenWithParent(); - - /** - * @param string $foreignDefaultSortby - * @return RelationFieldInterface - */ - public function setForeignDefaultSortby($foreignDefaultSortby); - - /** - * @return string - */ - public function getForeignDefaultSortby(); - - /** - * @param string $foreignLabel - * @return RelationFieldInterface - */ - public function setForeignLabel($foreignLabel); - - /** - * @return string - */ - public function getForeignLabel(); - - /** - * @param string $foreignSelector - * @return RelationFieldInterface - */ - public function setForeignSelector($foreignSelector); - - /** - * @return string - */ - public function getForeignSelector(); - - /** - * @param string $foreignSortby - * @return RelationFieldInterface - */ - public function setForeignSortby($foreignSortby); - - /** - * @return string - */ - public function getForeignSortby(); - - /** - * @param string $foreignTableField - * @return RelationFieldInterface - */ - public function setForeignTableField($foreignTableField); - - /** - * @return string - */ - public function getForeignTableField(); - - /** - * @param string $foreignUnique - * @return RelationFieldInterface - */ - public function setForeignUnique($foreignUnique); - - /** - * @return string - */ - public function getForeignUnique(); - - /** - * @param string $localizationMode - * @return RelationFieldInterface - */ - public function setLocalizationMode($localizationMode); - - /** - * @return string - */ - public function getLocalizationMode(); - - /** - * @param string $symmetricField - * @return RelationFieldInterface - */ - public function setSymmetricField($symmetricField); - - /** - * @return string - */ - public function getSymmetricField(); - - /** - * @param string $symmetricLabel - * @return RelationFieldInterface - */ - public function setSymmetricLabel($symmetricLabel); - - /** - * @return string - */ - public function getSymmetricLabel(); - - /** - * @param string $symmetricSortby - * @return RelationFieldInterface - */ - public function setSymmetricSortby($symmetricSortby); - - /** - * @return string - */ - public function getSymmetricSortby(); - - /** - * @param boolean $showThumbnails - * @return RelationFieldInterface - */ - public function setShowThumbnails($showThumbnails); - - /** - * @return boolean - */ - public function getShowThumbnails(); - - /** - * @param boolean|string $emptyOption - * @return RelationFieldInterface - */ - public function setEmptyOption($emptyOption); - - /** - * @return boolean|string - */ - public function getEmptyOption(); - - /** - * @return string - */ - public function getOppositeField(); - - /** - * @param string $oppositeField - * @return RelationFieldInterface - */ - public function setOppositeField($oppositeField); + public function setCondition(?string $condition): self; + public function getCondition(): ?string; + public function setForeignField(string $foreignField): self; + public function getForeignField(): ?string; + public function setManyToMany(?string $manyToMany): self; + public function getManyToMany(): ?string; + public function getMatchFields(): array; + public function setMatchFields(array $matchFields): self; + public function setTable(string $table): self; + public function getTable(): string; + public function setDisableMovingChildrenWithParent(bool $disableMovingChildrenWithParent): self; + public function getDisableMovingChildrenWithParent(): bool; + public function setForeignDefaultSortby(string $foreignDefaultSortby): self; + public function getForeignDefaultSortby(): ?string; + public function setForeignLabel(?string $foreignLabel): self; + public function getForeignLabel(): ?string; + public function setForeignSelector(?string $foreignSelector): self; + public function getForeignSelector(): ?string; + public function setForeignSortby(?string $foreignSortby): self; + public function getForeignSortby(): ?string; + public function setForeignTableField(?string $foreignTableField): self; + public function getForeignTableField(): ?string; + public function setForeignUnique(?string $foreignUnique): self; + public function getForeignUnique(): ?string; + public function setLocalizationMode(?string $localizationMode): self; + public function getLocalizationMode(): ?string; + public function setSymmetricField(?string $symmetricField): self; + public function getSymmetricField(): ?string; + public function setSymmetricLabel(?string $symmetricLabel): self; + public function getSymmetricLabel(): ?string; + public function setSymmetricSortby(?string $symmetricSortby): self; + public function getSymmetricSortby(): ?string; + public function setShowThumbnails(bool $showThumbnails): self; + public function getShowThumbnails(): bool; + public function setOppositeField(?string $oppositeField): self; + public function getOppositeField(): ?string; } diff --git a/Classes/ViewHelpers/Field/AbstractRelationFieldViewHelper.php b/Classes/ViewHelpers/Field/AbstractRelationFieldViewHelper.php index d35cb3eec..e950a5948 100755 --- a/Classes/ViewHelpers/Field/AbstractRelationFieldViewHelper.php +++ b/Classes/ViewHelpers/Field/AbstractRelationFieldViewHelper.php @@ -26,7 +26,8 @@ public function initializeArguments(): void $this->registerArgument( 'table', 'string', - 'Define foreign table name to turn selector into a record selector for that table' + 'Define foreign table name to turn selector into a record selector for that table', + true ); $this->registerArgument( 'condition', @@ -38,16 +39,12 @@ public function initializeArguments(): void 'foreignField', 'string', 'The `foreign_field` is the field of the child record pointing to the parent record. This defines where ' - . 'to store the uid of the parent record.', - false, - '' + . 'to store the uid of the parent record.' ); $this->registerArgument( 'foreignLabel', 'string', - "If set, it overrides the label set in `TCA[foreign_table]['ctrl']['label']` for the inline-view.", - false, - '' + "If set, it overrides the label set in `TCA[foreign_table]['ctrl']['label']` for the inline-view." ); $this->registerArgument( 'foreignSelector', @@ -61,26 +58,20 @@ public function initializeArguments(): void $this->registerArgument( 'foreignSortby', 'string', - 'Field on the child record (or on the intermediate table) that stores the manual sorting information.', - false, - '' + 'Field on the child record (or on the intermediate table) that stores the manual sorting information.' ); $this->registerArgument( 'foreignDefaultSortby', 'string', 'If a fieldname for `foreign_sortby` is defined, then this is ignored. Otherwise this is used as the ' - . '"ORDER BY" statement to sort the records in the table when listed.', - false, - '' + . '"ORDER BY" statement to sort the records in the table when listed.' ); $this->registerArgument( 'foreignTableField', 'string', 'The field of the child record pointing to the parent record. This defines where to store the table ' . 'name of the parent record. On setting this configuration key together with `foreign_field`, the child ' - . 'record knows what its parent record is - so the child record could also be used on other parent tables.', - false, - '' + . 'record knows what its parent record is - so the child record could also be used on other parent tables.' ); $this->registerArgument( 'foreignUnique', @@ -91,31 +82,23 @@ public function initializeArguments(): void 'symmetricField', 'string', 'In case of bidirectional symmetric relations, this defines in which field on the foreign table the ' - . 'uid of the "other" parent is stored.', - false, - '' + . 'uid of the "other" parent is stored.' ); $this->registerArgument( 'symmetricLabel', 'string', - 'If set, this overrides the default label of the selected `symmetric_field`.', - false, - '' + 'If set, this overrides the default label of the selected `symmetric_field`.' ); $this->registerArgument( 'symmetricSortby', 'string', 'Works like `foreign_sortby`, but defines the field on `foreign_table` where the "other" sort order is ' - . 'stored.', - false, - '' + . 'stored.' ); $this->registerArgument( 'localizationMode', 'string', - "Set whether children can be localizable ('select') or just inherit from default language ('keep').", - false, - '' + "Set whether children can be localizable ('select') or just inherit from default language ('keep')." ); $this->registerArgument( 'disableMovingChildrenWithParent', @@ -142,9 +125,7 @@ public function initializeArguments(): void $this->registerArgument( 'oppositeField', 'string', - 'Name of the opposite field related to a proper mm relation', - false, - '' + 'Name of the opposite field related to a proper mm relation' ); } diff --git a/Tests/Unit/ViewHelpers/AbstractViewHelperTestCase.php b/Tests/Unit/ViewHelpers/AbstractViewHelperTestCase.php index eee6fc657..2ada5587c 100755 --- a/Tests/Unit/ViewHelpers/AbstractViewHelperTestCase.php +++ b/Tests/Unit/ViewHelpers/AbstractViewHelperTestCase.php @@ -45,10 +45,7 @@ abstract class AbstractViewHelperTestCase extends AbstractTestCase protected array $templateProcessors = []; protected array $expressionTypes = []; - /** - * @var array - */ - protected $defaultArguments = [ + protected array $defaultArguments = [ 'name' => 'test' ]; diff --git a/Tests/Unit/ViewHelpers/Field/ControllerActionsViewHelperTest.php b/Tests/Unit/ViewHelpers/Field/ControllerActionsViewHelperTest.php index ba54ce646..b9b3a052c 100644 --- a/Tests/Unit/ViewHelpers/Field/ControllerActionsViewHelperTest.php +++ b/Tests/Unit/ViewHelpers/Field/ControllerActionsViewHelperTest.php @@ -14,10 +14,7 @@ class ControllerActionsViewHelperTest extends AbstractFieldViewHelperTestCase { - /** - * @var array - */ - protected $defaultArguments = [ + protected array $defaultArguments = [ 'label' => 'Test field', 'controllerExtensionName' => '', 'pluginName' => 'Flux', diff --git a/Tests/Unit/ViewHelpers/Field/InlineViewHelperTest.php b/Tests/Unit/ViewHelpers/Field/InlineViewHelperTest.php index d5c4ddee0..db499ae41 100644 --- a/Tests/Unit/ViewHelpers/Field/InlineViewHelperTest.php +++ b/Tests/Unit/ViewHelpers/Field/InlineViewHelperTest.php @@ -10,11 +10,9 @@ class InlineViewHelperTest extends AbstractFieldViewHelperTestCase { - /** - * @var array - */ - protected $defaultArguments = [ + protected array $defaultArguments = [ 'name' => 'test', + 'table' => 'tt_content', 'enabledControls' => [ 'new' => true, 'hide' => true diff --git a/Tests/Unit/ViewHelpers/Field/MultiRelationViewHelperTest.php b/Tests/Unit/ViewHelpers/Field/MultiRelationViewHelperTest.php index f6513c3bf..873fe6dbf 100644 --- a/Tests/Unit/ViewHelpers/Field/MultiRelationViewHelperTest.php +++ b/Tests/Unit/ViewHelpers/Field/MultiRelationViewHelperTest.php @@ -10,4 +10,8 @@ class MultiRelationViewHelperTest extends AbstractFieldViewHelperTestCase { + protected array $defaultArguments = [ + 'table' => 'tt_content', + 'name' => 'field', + ]; } diff --git a/Tests/Unit/ViewHelpers/Field/RelationViewHelperTest.php b/Tests/Unit/ViewHelpers/Field/RelationViewHelperTest.php index 010965dcc..57fb51a2a 100644 --- a/Tests/Unit/ViewHelpers/Field/RelationViewHelperTest.php +++ b/Tests/Unit/ViewHelpers/Field/RelationViewHelperTest.php @@ -10,4 +10,8 @@ class RelationViewHelperTest extends AbstractFieldViewHelperTestCase { + protected array $defaultArguments = [ + 'table' => 'tt_content', + 'name' => 'field', + ]; } diff --git a/Tests/Unit/ViewHelpers/Field/TextViewHelperTest.php b/Tests/Unit/ViewHelpers/Field/TextViewHelperTest.php index c1de0ffb9..b50283b20 100644 --- a/Tests/Unit/ViewHelpers/Field/TextViewHelperTest.php +++ b/Tests/Unit/ViewHelpers/Field/TextViewHelperTest.php @@ -10,10 +10,7 @@ class TextViewHelperTest extends AbstractFieldViewHelperTestCase { - /** - * @var array - */ - protected $defaultArguments = [ + protected array $defaultArguments = [ 'name' => 'test', ]; diff --git a/Tests/Unit/ViewHelpers/Field/TreeViewHelperTest.php b/Tests/Unit/ViewHelpers/Field/TreeViewHelperTest.php index abdeea481..6bc482084 100644 --- a/Tests/Unit/ViewHelpers/Field/TreeViewHelperTest.php +++ b/Tests/Unit/ViewHelpers/Field/TreeViewHelperTest.php @@ -10,4 +10,8 @@ class TreeViewHelperTest extends SelectViewHelperTest { + protected array $defaultArguments = [ + 'table' => 'tt_content', + 'name' => 'field', + ]; } diff --git a/Tests/Unit/ViewHelpers/Field/UserFuncViewHelperTest.php b/Tests/Unit/ViewHelpers/Field/UserFuncViewHelperTest.php index 22d6d4bf3..8984eff91 100644 --- a/Tests/Unit/ViewHelpers/Field/UserFuncViewHelperTest.php +++ b/Tests/Unit/ViewHelpers/Field/UserFuncViewHelperTest.php @@ -10,10 +10,7 @@ class UserFuncViewHelperTest extends AbstractFieldViewHelperTestCase { - /** - * @var array - */ - protected $defaultArguments = [ + protected array $defaultArguments = [ 'name' => 'test', 'userFunc' => '', ]; diff --git a/Tests/Unit/ViewHelpers/FieldViewHelperTest.php b/Tests/Unit/ViewHelpers/FieldViewHelperTest.php index d89f3b354..46718102c 100644 --- a/Tests/Unit/ViewHelpers/FieldViewHelperTest.php +++ b/Tests/Unit/ViewHelpers/FieldViewHelperTest.php @@ -12,10 +12,7 @@ class FieldViewHelperTest extends AbstractFieldViewHelperTestCase { - /** - * @var array - */ - protected $defaultArguments = [ + protected array $defaultArguments = [ 'name' => 'test', 'type' => 'input', ]; diff --git a/Tests/Unit/ViewHelpers/FormViewHelperTest.php b/Tests/Unit/ViewHelpers/FormViewHelperTest.php index 84300b615..d6514ff9d 100644 --- a/Tests/Unit/ViewHelpers/FormViewHelperTest.php +++ b/Tests/Unit/ViewHelpers/FormViewHelperTest.php @@ -13,7 +13,7 @@ class FormViewHelperTest extends AbstractViewHelperTestCase { - protected $defaultArguments = [ + protected array $defaultArguments = [ 'icon' => 'foobar', ]; diff --git a/Tests/Unit/ViewHelpers/GridViewHelperTest.php b/Tests/Unit/ViewHelpers/GridViewHelperTest.php index 77853440b..bea6086f5 100644 --- a/Tests/Unit/ViewHelpers/GridViewHelperTest.php +++ b/Tests/Unit/ViewHelpers/GridViewHelperTest.php @@ -12,7 +12,7 @@ class GridViewHelperTest extends AbstractViewHelperTestCase { - protected $defaultArguments = [ + protected array $defaultArguments = [ 'name' => 'grid', 'label' => 'Foo Bar', 'variables' => [],