diff --git a/.phpcq.lock b/.phpcq.lock index b91d34e09..707f6880b 100644 --- a/.phpcq.lock +++ b/.phpcq.lock @@ -1 +1 @@ -{"plugins":{"phpunit":{"api-version":"1.0.0","version":"1.0.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpunit/phpunit-1.0.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0"},"tool":{"phpunit":"^6.0 || ^7.0 || ^8.0 || ^9.0"}},"checksum":{"type":"sha-512","value":"c73f15658e3ba62665f09492ec91c3a6a715760bfaa88473a987538439fff442540148e086e46a6aa18ce55a3ea2fbf76caaa581384cb84a38859fcc609ae7e4"},"tools":{"phpunit":{"version":"9.6.29","url":"https://phar.phpunit.de/phpunit-9.6.29.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*","ext-json":"*","ext-libxml":"*","ext-mbstring":"*","ext-xml":"*","ext-xmlwriter":"*"}},"checksum":{"type":"sha-256","value":"04aeb9aa94da2912a9d1ddfaa047bfb7a87ac74735d3f7d61585b47900ede2d7"},"signature":"https://phar.phpunit.de/phpunit-9.6.29.phar.asc"}},"composerLock":null},"psalm":{"api-version":"1.0.0","version":"1.3.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/psalm/psalm-1.3.0.0.php","signature":null,"requirements":{"php":{"php":"^7.4 || ^8.0","ext-dom":"*"},"tool":{"psalm":"^3.0 || ^4.0 || ^5.0 || ^6.0"}},"checksum":{"type":"sha-512","value":"4a550c9226d7bca582d7c10bd87cce01190c96398936b1613421640c83df62ed1c6e0d44c1b39635414ea8cf4a892a6458d27590793238add24e7cb5547e6ffd"},"tools":{"psalm":{"version":"6.13.1","url":"https://github.com/vimeo/psalm/releases/download/6.13.1/psalm.phar","requirements":{"php":{"php":"~8.2.27 || ~8.3.16 || ~8.4.3","ext-SimpleXML":"*","ext-ctype":"*","ext-dom":"*","ext-json":"*","ext-libxml":"*","ext-mbstring":"*","ext-tokenizer":"*"}},"checksum":null,"signature":"https://github.com/vimeo/psalm/releases/download/6.13.1/psalm.phar.asc"}},"composerLock":null},"composer-require-checker":{"api-version":"1.0.0","version":"1.1.1.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/composer-require-checker/composer-require-checker-1.1.1.0.php","signature":null,"requirements":{"php":{"php":"^7.4 || ^8.0"},"tool":{"composer-require-checker":"^3.8 || ^4.0"}},"checksum":{"type":"sha-512","value":"d5415bddfe024c5749d894034583882aee4e5c3e1087815d9fdd81cb5e71630f631a0e35de0ff84b97fbbf738c16ece5f83bd8c00695913eb846aa6f04577dc2"},"tools":{"composer-require-checker":{"version":"4.16.1","url":"https://github.com/maglnet/ComposerRequireChecker/releases/download/4.16.1/composer-require-checker.phar","requirements":{"php":{"php":"~8.2.0 || ~8.3.0 || ~8.4.0","ext-phar":"*"}},"checksum":null,"signature":"https://github.com/maglnet/ComposerRequireChecker/releases/download/4.16.1/composer-require-checker.phar.asc"}},"composerLock":null},"phpmd":{"api-version":"1.0.0","version":"1.0.2.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpmd/phpmd-1.0.2.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpmd":"^2.6.1"}},"checksum":{"type":"sha-512","value":"f22280a6dec8dbdd2ec1d83b294f23237fe32c34f4a298e52038e0a7a0074d541635b2b488b1a6098a42d8418a6cd8eb804406ea82b91e362be2b5d11a0915b0"},"tools":{"phpmd":{"version":"2.15.0","url":"https://github.com/phpmd/phpmd/releases/download/2.15.0/phpmd.phar","requirements":{"php":{"php":">=5.3.9","ext-xml":"*"}},"checksum":null,"signature":"https://github.com/phpmd/phpmd/releases/download/2.15.0/phpmd.phar.asc"}},"composerLock":null},"phpcpd":{"api-version":"1.0.0","version":"1.1.1.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpcpd/phpcpd-1.1.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpcpd":"^6.0"}},"checksum":{"type":"sha-512","value":"1189ce0bf3fade4cb4241f1d96f915ef8fc7651f4450dc79fdf464ee3d6be3009316f0d423ce2d4af9d76ad50807b7fdf4d77bfa6d9ee2c91d6eda32ea214433"},"tools":{"phpcpd":{"version":"6.0.3","url":"https://phar.phpunit.de/phpcpd-6.0.3.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*"}},"checksum":{"type":"sha-256","value":"2cbaea7cfda1bb4299d863eb075e977c3f49055dd16d88529fae5150d48a84cb"},"signature":"https://phar.phpunit.de/phpcpd-6.0.3.phar.asc"}},"composerLock":null},"phploc":{"api-version":"1.0.0","version":"1.0.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phploc/phploc-1.0.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*","ext-json":"*"},"tool":{"phploc":"^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0"}},"checksum":{"type":"sha-512","value":"f67b02d494796adf553cb3dd13ec06c1cb8e53c799954061749424251379541637538199afb3afa3c7a01cabd1cb6f1c53eb621f015dff9644c6c7cbf10c56d1"},"tools":{"phploc":{"version":"7.0.2","url":"https://phar.phpunit.de/phploc-7.0.2.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*","ext-json":"*"}},"checksum":{"type":"sha-256","value":"3d59778ec86faf25fd00e3a329b2f9ad4a3c751ca91601ea7dab70f887b0bf46"},"signature":"https://phar.phpunit.de/phploc-7.0.2.phar.asc"}},"composerLock":null},"phpcs":{"api-version":"1.0.0","version":"1.2.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpcs/phpcs-1.2.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpcs":"^3.0 || ^2.0","phpcbf":"^3.0 || ^2.0"}},"checksum":{"type":"sha-512","value":"b6ed00306e76068a6af5e3b1dec837724f9e1900ef1049ce88e7ce195b0583524ca33a73613fba13244307a7ca853b6ddaa14ded69f651c3f184ac130bd1aaad"},"tools":{"phpcs":{"version":"3.13.4","url":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.13.4/phpcs.phar","requirements":{"php":{"php":">=5.4.0","ext-simplexml":"*","ext-tokenizer":"*","ext-xmlwriter":"*"}},"checksum":null,"signature":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.13.4/phpcs.phar.asc"},"phpcbf":{"version":"3.13.4","url":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.13.4/phpcbf.phar","requirements":{"php":{"php":">=5.4.0","ext-simplexml":"*","ext-tokenizer":"*","ext-xmlwriter":"*"}},"checksum":null,"signature":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.13.4/phpcbf.phar.asc"}},"composerLock":null},"composer-normalize":{"api-version":"1.0.0","version":"1.1.1.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/composer-normalize/composer-normalize-1.1.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-json":"*"},"tool":{"composer-normalize":"^2.1"}},"checksum":{"type":"sha-512","value":"d9abda440b85d501c58abf9c81bf76f417594b397129215ffa8b777e9bb5e5eda37d7661d661db3c8d11c24f20345bc6fbe56f013b3b9435d459d2b94f086e0f"},"tools":{"composer-normalize":{"version":"2.48.2","url":"https://github.com/ergebnis/composer-normalize/releases/download/2.48.2/composer-normalize.phar","requirements":{"php":{"php":"~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0","ext-json":"*"}},"checksum":null,"signature":"https://github.com/ergebnis/composer-normalize/releases/download/2.48.2/composer-normalize.phar.asc"}},"composerLock":null}},"tools":[]} +{"plugins":{"phpunit":{"api-version":"1.0.0","version":"1.1.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpunit/phpunit-1.1.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0"},"tool":{"phpunit":"^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0"}},"checksum":{"type":"sha-512","value":"c73f15658e3ba62665f09492ec91c3a6a715760bfaa88473a987538439fff442540148e086e46a6aa18ce55a3ea2fbf76caaa581384cb84a38859fcc609ae7e4"},"tools":{"phpunit":{"version":"9.6.34","url":"https://phar.phpunit.de/phpunit-9.6.34.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*","ext-json":"*","ext-libxml":"*","ext-mbstring":"*","ext-xml":"*","ext-xmlwriter":"*"}},"checksum":{"type":"sha-256","value":"e7264ae61fe58a487c2bd741905b85940d8fbc2b32cf4a279949b6d9a172a06a"},"signature":"https://phar.phpunit.de/phpunit-9.6.34.phar.asc"}},"composerLock":null},"psalm":{"api-version":"1.0.0","version":"1.3.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/psalm/psalm-1.3.0.0.php","signature":null,"requirements":{"php":{"php":"^7.4 || ^8.0","ext-dom":"*"},"tool":{"psalm":"^3.0 || ^4.0 || ^5.0 || ^6.0"}},"checksum":{"type":"sha-512","value":"4a550c9226d7bca582d7c10bd87cce01190c96398936b1613421640c83df62ed1c6e0d44c1b39635414ea8cf4a892a6458d27590793238add24e7cb5547e6ffd"},"tools":{"psalm":{"version":"6.15.0","url":"https://github.com/vimeo/psalm/releases/download/6.15.0/psalm.phar","requirements":{"php":{"php":"~8.2.27 || ~8.3.16 || ~8.4.3 || ~8.5.0","ext-SimpleXML":"*","ext-ctype":"*","ext-dom":"*","ext-json":"*","ext-libxml":"*","ext-mbstring":"*","ext-tokenizer":"*"}},"checksum":null,"signature":"https://github.com/vimeo/psalm/releases/download/6.15.0/psalm.phar.asc"}},"composerLock":null},"composer-require-checker":{"api-version":"1.0.0","version":"1.1.1.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/composer-require-checker/composer-require-checker-1.1.1.0.php","signature":null,"requirements":{"php":{"php":"^7.4 || ^8.0"},"tool":{"composer-require-checker":"^3.8 || ^4.0"}},"checksum":{"type":"sha-512","value":"d5415bddfe024c5749d894034583882aee4e5c3e1087815d9fdd81cb5e71630f631a0e35de0ff84b97fbbf738c16ece5f83bd8c00695913eb846aa6f04577dc2"},"tools":{"composer-require-checker":{"version":"4.18.0","url":"https://github.com/maglnet/ComposerRequireChecker/releases/download/4.18.0/composer-require-checker.phar","requirements":{"php":{"php":"~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0","ext-phar":"*"}},"checksum":null,"signature":"https://github.com/maglnet/ComposerRequireChecker/releases/download/4.18.0/composer-require-checker.phar.asc"}},"composerLock":null},"phpmd":{"api-version":"1.0.0","version":"1.0.2.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpmd/phpmd-1.0.2.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpmd":"^2.6.1"}},"checksum":{"type":"sha-512","value":"f22280a6dec8dbdd2ec1d83b294f23237fe32c34f4a298e52038e0a7a0074d541635b2b488b1a6098a42d8418a6cd8eb804406ea82b91e362be2b5d11a0915b0"},"tools":{"phpmd":{"version":"2.15.0","url":"https://github.com/phpmd/phpmd/releases/download/2.15.0/phpmd.phar","requirements":{"php":{"php":">=5.3.9","ext-xml":"*"}},"checksum":null,"signature":"https://github.com/phpmd/phpmd/releases/download/2.15.0/phpmd.phar.asc"}},"composerLock":null},"phpcpd":{"api-version":"1.0.0","version":"1.1.1.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpcpd/phpcpd-1.1.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpcpd":"^6.0"}},"checksum":{"type":"sha-512","value":"1189ce0bf3fade4cb4241f1d96f915ef8fc7651f4450dc79fdf464ee3d6be3009316f0d423ce2d4af9d76ad50807b7fdf4d77bfa6d9ee2c91d6eda32ea214433"},"tools":{"phpcpd":{"version":"6.0.3","url":"https://phar.phpunit.de/phpcpd-6.0.3.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*"}},"checksum":{"type":"sha-256","value":"2cbaea7cfda1bb4299d863eb075e977c3f49055dd16d88529fae5150d48a84cb"},"signature":"https://phar.phpunit.de/phpcpd-6.0.3.phar.asc"}},"composerLock":null},"phploc":{"api-version":"1.0.0","version":"1.0.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phploc/phploc-1.0.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*","ext-json":"*"},"tool":{"phploc":"^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0"}},"checksum":{"type":"sha-512","value":"f67b02d494796adf553cb3dd13ec06c1cb8e53c799954061749424251379541637538199afb3afa3c7a01cabd1cb6f1c53eb621f015dff9644c6c7cbf10c56d1"},"tools":{"phploc":{"version":"7.0.2","url":"https://phar.phpunit.de/phploc-7.0.2.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*","ext-json":"*"}},"checksum":{"type":"sha-256","value":"3d59778ec86faf25fd00e3a329b2f9ad4a3c751ca91601ea7dab70f887b0bf46"},"signature":"https://phar.phpunit.de/phploc-7.0.2.phar.asc"}},"composerLock":null},"phpcs":{"api-version":"1.0.0","version":"1.2.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpcs/phpcs-1.2.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpcs":"^3.0 || ^2.0","phpcbf":"^3.0 || ^2.0"}},"checksum":{"type":"sha-512","value":"b6ed00306e76068a6af5e3b1dec837724f9e1900ef1049ce88e7ce195b0583524ca33a73613fba13244307a7ca853b6ddaa14ded69f651c3f184ac130bd1aaad"},"tools":{"phpcs":{"version":"3.13.5","url":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.13.5/phpcs.phar","requirements":{"php":{"php":">=5.4.0","ext-simplexml":"*","ext-tokenizer":"*","ext-xmlwriter":"*"}},"checksum":null,"signature":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.13.5/phpcs.phar.asc"},"phpcbf":{"version":"3.13.5","url":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.13.5/phpcbf.phar","requirements":{"php":{"php":">=5.4.0","ext-simplexml":"*","ext-tokenizer":"*","ext-xmlwriter":"*"}},"checksum":null,"signature":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.13.5/phpcbf.phar.asc"}},"composerLock":null},"composer-normalize":{"api-version":"1.0.0","version":"1.1.1.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/composer-normalize/composer-normalize-1.1.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-json":"*"},"tool":{"composer-normalize":"^2.1"}},"checksum":{"type":"sha-512","value":"d9abda440b85d501c58abf9c81bf76f417594b397129215ffa8b777e9bb5e5eda37d7661d661db3c8d11c24f20345bc6fbe56f013b3b9435d459d2b94f086e0f"},"tools":{"composer-normalize":{"version":"2.49.0","url":"https://github.com/ergebnis/composer-normalize/releases/download/2.49.0/composer-normalize.phar","requirements":{"php":{"php":"~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0","ext-json":"*"}},"checksum":null,"signature":"https://github.com/ergebnis/composer-normalize/releases/download/2.49.0/composer-normalize.phar.asc"}},"composerLock":null}},"tools":[]} \ No newline at end of file diff --git a/.phpcq.yaml.dist b/.phpcq.yaml.dist index dac15ddbb..ac6a93fad 100644 --- a/.phpcq.yaml.dist +++ b/.phpcq.yaml.dist @@ -12,6 +12,9 @@ phpcq: phpunit: version: ^1.0 signed: false + requirements: + phpunit: + version: ^9.6.22 psalm: version: ^1.0 signed: false @@ -41,6 +44,7 @@ phpcq: # psalm - 8A03EA3B385DBAA1 - 12CE0F1D262429A5 + - 99BF4D9A33D65E1E # magl@magll.net - D2CCAC42F6295E7D # PHP_CodeSniffer diff --git a/composer.json b/composer.json index 7fd43d81d..0a40a89f2 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "contao-community-alliance/meta-palettes": "^2.0.10", "contao-community-alliance/translator": "^2.5", "contao-community-alliance/url-builder": "^2.0", - "contao/core-bundle": "^5.3 <5.7", + "contao/core-bundle": "^5.3", "discordier/justtextwidgets": "^2.0", "doctrine/cache": "^2.1", "doctrine/dbal": "^3.6", diff --git a/src/Attribute/AbstractAttributeTypeFactory.php b/src/Attribute/AbstractAttributeTypeFactory.php index 68e436787..c27b1158d 100644 --- a/src/Attribute/AbstractAttributeTypeFactory.php +++ b/src/Attribute/AbstractAttributeTypeFactory.php @@ -54,6 +54,7 @@ abstract class AbstractAttributeTypeFactory implements IAttributeTypeFactory /** * {@inheritdoc} */ + #[\Override] public function getTypeName() { return $this->typeName; @@ -62,6 +63,7 @@ public function getTypeName() /** * {@inheritdoc} */ + #[\Override] public function getTypeIcon() { return $this->typeIcon; @@ -70,6 +72,7 @@ public function getTypeIcon() /** * {@inheritdoc} */ + #[\Override] public function createInstance($information, $metaModel) { return new $this->typeClass($metaModel, $information); @@ -88,6 +91,7 @@ protected function __construct() * * @return bool */ + #[\Override] public function isTranslatedType() { return \in_array('MetaModels\Attribute\ITranslated', (array) \class_implements($this->typeClass), true); @@ -98,6 +102,7 @@ public function isTranslatedType() * * @return bool */ + #[\Override] public function isSimpleType() { return \in_array('MetaModels\Attribute\ISimple', (array) \class_implements($this->typeClass), true); @@ -108,6 +113,7 @@ public function isSimpleType() * * @return bool */ + #[\Override] public function isComplexType() { return \in_array('MetaModels\Attribute\IComplex', (array) \class_implements($this->typeClass), true); diff --git a/src/Attribute/AbstractSimpleAttributeTypeFactory.php b/src/Attribute/AbstractSimpleAttributeTypeFactory.php index d00021835..7f091be80 100644 --- a/src/Attribute/AbstractSimpleAttributeTypeFactory.php +++ b/src/Attribute/AbstractSimpleAttributeTypeFactory.php @@ -60,6 +60,7 @@ protected function __construct(Connection $connection, TableManipulator $tableMa /** * {@inheritDoc} */ + #[\Override] public function createInstance($information, $metaModel) { return new $this->typeClass($metaModel, $information, $this->connection, $this->tableManipulator); diff --git a/src/Attribute/AttributeFactory.php b/src/Attribute/AttributeFactory.php index d00adbe6f..406f561cf 100644 --- a/src/Attribute/AttributeFactory.php +++ b/src/Attribute/AttributeFactory.php @@ -83,6 +83,7 @@ public function __construct(EventDispatcherInterface $eventDispatcher) * * @deprecated The service container will get removed, use the symfony service container instead. */ + #[\Override] public function setServiceContainer(IMetaModelsServiceContainer $serviceContainer, $deprecationNotice = true) { if ($deprecationNotice) { @@ -123,6 +124,7 @@ public function setServiceContainer(IMetaModelsServiceContainer $serviceContaine * * @deprecated The service container will get removed, use the symfony service container instead. */ + #[\Override] public function getServiceContainer() { // @codingStandardsIgnoreStart @@ -146,6 +148,7 @@ public function getServiceContainer() * * @return IAttribute|null */ + #[\Override] public function createAttribute($information, $metaModel) { $event = new CreateAttributeEvent($information, $metaModel); @@ -172,6 +175,7 @@ public function createAttribute($information, $metaModel) * * @throws \RuntimeException When the type is already registered. */ + #[\Override] public function addTypeFactory(IAttributeTypeFactory $typeFactory) { $typeName = $typeFactory->getTypeName(); @@ -187,6 +191,7 @@ public function addTypeFactory(IAttributeTypeFactory $typeFactory) /** * {@inheritdoc} */ + #[\Override] public function getTypeFactory($typeFactory) { return $this->typeFactories[$typeFactory] ?? null; @@ -195,6 +200,7 @@ public function getTypeFactory($typeFactory) /** * {@inheritdoc} */ + #[\Override] public function attributeTypeMatchesFlags($factory, $flags) { $factory = $this->getTypeFactory($factory); @@ -215,6 +221,7 @@ public function attributeTypeMatchesFlags($factory, $flags) /** * {@inheritdoc} */ + #[\Override] public function getTypeNames($flags = false) { if ($flags === false) { @@ -236,6 +243,7 @@ public function getTypeNames($flags = false) /** * {@inheritdoc} */ + #[\Override] public function collectAttributeInformation(IMetaModel $metaModel) { $event = new CollectMetaModelAttributeInformationEvent($metaModel); @@ -248,6 +256,7 @@ public function collectAttributeInformation(IMetaModel $metaModel) /** * {@inheritdoc} */ + #[\Override] public function createAttributesForMetaModel($metaModel) { $attributes = array(); @@ -264,6 +273,7 @@ public function createAttributesForMetaModel($metaModel) /** * {@inheritdoc} */ + #[\Override] public function getIconForType($type) { return isset($this->typeFactories[$type]) ? $this->typeFactories[$type]->getTypeIcon() : ''; diff --git a/src/Attribute/Base.php b/src/Attribute/Base.php index 28aff1e0d..e383552c4 100644 --- a/src/Attribute/Base.php +++ b/src/Attribute/Base.php @@ -123,6 +123,7 @@ protected function parameterMask($parameters) * * @return string the human-readable name */ + #[\Override] public function getName() { if (isset($this->arrData['name']) && \is_array($this->arrData['name'])) { @@ -289,6 +290,7 @@ protected function prepareTemplate(Template $objTemplate, $arrRowData, $objSetti /** * {@inheritdoc} */ + #[\Override] public function getColName() { $colName = $this->arrData['colname']; @@ -300,6 +302,7 @@ public function getColName() /** * {@inheritdoc} */ + #[\Override] public function getMetaModel() { return $this->metaModel; @@ -308,6 +311,7 @@ public function getMetaModel() /** * {@inheritdoc} */ + #[\Override] public function get($strKey) { return $this->arrData[$strKey] ?? null; @@ -316,6 +320,7 @@ public function get($strKey) /** * {@inheritdoc} */ + #[\Override] public function set($strKey, $varValue) { if (in_array($strKey, $this->getAttributeSettingNames())) { @@ -338,6 +343,7 @@ public function set($strKey, $varValue) * * @deprecated Implement schema generators instead - see #1267. */ + #[\Override] public function handleMetaChange($strMetaName, $varNewValue) { // By default, we accept any change of meta information. @@ -357,6 +363,7 @@ public function handleMetaChange($strMetaName, $varNewValue) * * @deprecated Implement schema generators instead - see #1267. */ + #[\Override] public function destroyAUX() { if ($this->isManagedAttribute($this->get('type'))) { @@ -373,6 +380,7 @@ public function destroyAUX() * * @deprecated Implement schema generators instead - see #1267. */ + #[\Override] public function initializeAUX() { if ($this->isManagedAttribute($this->get('type'))) { @@ -387,6 +395,7 @@ public function initializeAUX() /** * {@inheritdoc} */ + #[\Override] public function getAttributeSettingNames() { return [ @@ -547,6 +556,7 @@ private function setBaseEval($fieldDefinition, $overrides) /** * {@inheritdoc} */ + #[\Override] public function getFieldDefinition($arrOverrides = []) { $arrFieldDef = $this->setBaseEval($this->getBaseDefinition(), $arrOverrides); @@ -577,6 +587,7 @@ public function getFieldDefinition($arrOverrides = []) * * @deprecated Use DataDefinition builders in DC_General 2.0.0 */ + #[\Override] public function getItemDCA($arrOverrides = []) { return [ @@ -590,6 +601,7 @@ public function getItemDCA($arrOverrides = []) /** * {@inheritdoc} */ + #[\Override] public function valueToWidget($varValue) { return $varValue; @@ -598,6 +610,7 @@ public function valueToWidget($varValue) /** * {@inheritdoc} */ + #[\Override] public function widgetToValue($varValue, $itemId) { return $varValue; @@ -606,6 +619,7 @@ public function widgetToValue($varValue, $itemId) /** * {@inheritdoc} */ + #[\Override] public function getDefaultRenderSettings() { return new Simple(['template' => 'mm_attr_' . ($this->get('type') ?? '')]); @@ -614,6 +628,7 @@ public function getDefaultRenderSettings() /** * {@inheritdoc} */ + #[\Override] public function parseValue($arrRowData, $strOutputFormat = 'text', $objSettings = null) { $arrResult = ['raw' => ($arrRowData[$this->getColName()] ?? null)]; @@ -658,6 +673,7 @@ public function parseValue($arrRowData, $strOutputFormat = 'text', $objSettings * * This base implementation returns the value itself. */ + #[\Override] public function getFilterUrlValue($varValue) { // We are parsing as text here as this was the way before this method was implemented. See #216. @@ -669,6 +685,7 @@ public function getFilterUrlValue($varValue) /** * {@inheritdoc} */ + #[\Override] public function sortIds($idList, $strDirection) { // Base implementation, do not perform any sorting. @@ -679,6 +696,7 @@ public function sortIds($idList, $strDirection) * {@inheritdoc} * Base implementation, do not perform any search; */ + #[\Override] public function searchFor($strPattern) { return []; @@ -691,6 +709,7 @@ public function searchFor($strPattern) * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ + #[\Override] public function filterGreaterThan($varValue, $blnInclusive = false) { return []; @@ -703,6 +722,7 @@ public function filterGreaterThan($varValue, $blnInclusive = false) * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ + #[\Override] public function filterLessThan($varValue, $blnInclusive = false) { return []; @@ -712,6 +732,7 @@ public function filterLessThan($varValue, $blnInclusive = false) * {@inheritdoc} * Base implementation, merge the result of filterLessThan() and filterGreaterThan(). */ + #[\Override] public function filterNotEqual($varValue) { return \array_merge($this->filterLessThan($varValue) ?? [], $this->filterGreaterThan($varValue) ?? []); @@ -721,6 +742,7 @@ public function filterNotEqual($varValue) * {@inheritdoc} * Base implementation, do not perform anything. */ + #[\Override] public function modelSaved($objItem) { // No-op. diff --git a/src/Attribute/BaseSimple.php b/src/Attribute/BaseSimple.php index 14940fdc3..10c5c1947 100644 --- a/src/Attribute/BaseSimple.php +++ b/src/Attribute/BaseSimple.php @@ -128,6 +128,7 @@ public function __construct( * * @deprecated Implement schema generators instead. */ + #[\Override] public function handleMetaChange($strMetaName, $varNewValue) { if ($this->isManagedAttribute($this->get('type'))) { @@ -158,6 +159,7 @@ public function handleMetaChange($strMetaName, $varNewValue) * * @throws Exception */ + #[\Override] public function setDataFor($arrValues) { $strTable = $this->getMetaModel()->getTableName(); @@ -179,6 +181,7 @@ public function setDataFor($arrValues) * * @throws Exception */ + #[\Override] public function getFilterOptions($idList, $usedOnly, &$arrCount = null) { // If empty list, return empty result. See also #379 for discussion. @@ -224,6 +227,7 @@ public function getFilterOptions($idList, $usedOnly, &$arrCount = null) * * @throws Exception */ + #[\Override] public function sortIds($idList, $strDirection) { // Base implementation, do a simple sorting on given column. @@ -245,6 +249,7 @@ public function sortIds($idList, $strDirection) * * Base implementation, perform string matching search. */ + #[\Override] public function searchFor($strPattern) { // Base implementation, do a simple search on given column. @@ -272,6 +277,7 @@ public function searchFor($strPattern) * * @deprecated Implement schema generators instead - see #1267. */ + #[\Override] public function getSQLDataType() { if ($this->isManagedAttribute($this->get('type'))) { @@ -288,6 +294,7 @@ public function getSQLDataType() * * @deprecated Implement schema generators instead - see #1267. */ + #[\Override] public function destroyAUX() { if ($this->isManagedAttribute($this->get('type'))) { @@ -314,6 +321,7 @@ public function destroyAUX() * * @deprecated Implement schema generators instead - see #1267. */ + #[\Override] public function initializeAUX() { if ($this->isManagedAttribute($this->get('type'))) { @@ -342,6 +350,7 @@ public function initializeAUX() * * @deprecated Implement schema generators instead - see #1267. */ + #[\Override] public function createColumn() { if ($this->isManagedAttribute($this->get('type'))) { @@ -371,6 +380,7 @@ public function createColumn() * * @deprecated Implement schema generators instead - see #1267. */ + #[\Override] public function deleteColumn() { if ($this->isManagedAttribute($this->get('type'))) { @@ -401,6 +411,7 @@ public function deleteColumn() * * @deprecated Implement schema generators instead - see #1267. */ + #[\Override] public function renameColumn($strNewColumnName) { if ($this->isManagedAttribute($this->get('type'))) { @@ -440,6 +451,7 @@ public function renameColumn($strNewColumnName) * * @return mixed */ + #[\Override] public function unserializeData($value) { return $value; @@ -452,6 +464,7 @@ public function unserializeData($value) * * @return string|null */ + #[\Override] public function serializeData($value) { if (empty($value)) { diff --git a/src/Attribute/ITranslated.php b/src/Attribute/ITranslated.php index 6c971059c..fc47f1d54 100644 --- a/src/Attribute/ITranslated.php +++ b/src/Attribute/ITranslated.php @@ -35,6 +35,7 @@ interface ITranslated extends IAttribute * * @return ITranslatedMetaModel the MetaModel instance. */ + #[\Override] public function getMetaModel(); /** diff --git a/src/Attribute/TranslatedReference.php b/src/Attribute/TranslatedReference.php index 06828271c..f7cea603e 100644 --- a/src/Attribute/TranslatedReference.php +++ b/src/Attribute/TranslatedReference.php @@ -174,6 +174,7 @@ protected function getOptionizer() /** * {@inheritDoc} */ + #[\Override] public function valueToWidget($varValue) { return $varValue['value'] ?? null; @@ -184,6 +185,7 @@ public function valueToWidget($varValue) * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ + #[\Override] public function widgetToValue($varValue, $itemId) { return [ @@ -196,6 +198,7 @@ public function widgetToValue($varValue, $itemId) /** * {@inheritDoc} */ + #[\Override] public function getDataFor($arrIds) { $strActiveLanguage = $this->getActiveLanguage(); @@ -252,6 +255,7 @@ private function determineLanguages() /** * {@inheritDoc} */ + #[\Override] public function setDataFor($arrValues) { foreach ($this->determineLanguages() as $strLangCode) { @@ -262,6 +266,7 @@ public function setDataFor($arrValues) /** * {@inheritDoc} */ + #[\Override] public function unsetDataFor($arrIds) { foreach ($this->determineLanguages() as $strLangCode) { @@ -272,6 +277,7 @@ public function unsetDataFor($arrIds) /** * {@inheritDoc} */ + #[\Override] public function searchFor($strPattern) { // Search at active language and return findings. @@ -295,6 +301,7 @@ public function searchFor($strPattern) /** * {@inheritDoc} */ + #[\Override] public function searchForInLanguages($strPattern, $arrLanguages = []) { if (empty($optionizer = $this->getOptionizer())) { @@ -321,6 +328,7 @@ public function searchForInLanguages($strPattern, $arrLanguages = []) /** * {@inheritDoc} */ + #[\Override] public function sortIds($idList, $strDirection) { $queryBuilder = $this->connection->createQueryBuilder(); @@ -359,6 +367,7 @@ public function sortIds($idList, $strDirection) /** * {@inheritDoc} */ + #[\Override] public function getFilterOptions($idList, $usedOnly, &$arrCount = null) { $queryBuilder = $this->connection->createQueryBuilder() @@ -381,6 +390,7 @@ public function getFilterOptions($idList, $usedOnly, &$arrCount = null) /** * {@inheritDoc} */ + #[\Override] public function setTranslatedDataFor($arrValues, $strLangCode) { if ('' === $strLangCode) { @@ -448,6 +458,7 @@ protected function fetchExistingIdsFor($idList, $langCode) /** * {@inheritDoc} */ + #[\Override] public function getTranslatedDataFor($arrIds, $strLangCode) { if ('' === $strLangCode) { @@ -471,6 +482,7 @@ public function getTranslatedDataFor($arrIds, $strLangCode) /** * {@inheritDoc} */ + #[\Override] public function unsetValueFor($arrIds, $strLangCode) { if ('' === $strLangCode) { diff --git a/src/BackendIntegration/InputScreen/InputScreen.php b/src/BackendIntegration/InputScreen/InputScreen.php index af6ab2d0e..ac4e520a2 100644 --- a/src/BackendIntegration/InputScreen/InputScreen.php +++ b/src/BackendIntegration/InputScreen/InputScreen.php @@ -411,6 +411,7 @@ protected function transformGroupSort($rows) /** * {@inheritDoc} */ + #[\Override] public function getId() { return (int) $this->data['id']; @@ -419,6 +420,7 @@ public function getId() /** * {@inheritDoc} */ + #[\Override] public function getLegends() { return $this->legends; @@ -427,6 +429,7 @@ public function getLegends() /** * {@inheritDoc} */ + #[\Override] public function getLegendNames() { return \array_keys($this->legends); @@ -435,6 +438,7 @@ public function getLegendNames() /** * {@inheritDoc} */ + #[\Override] public function getLegend($name) { return $this->legends[$name]; @@ -443,6 +447,7 @@ public function getLegend($name) /** * {@inheritDoc} */ + #[\Override] public function getProperties() { return $this->properties; @@ -451,6 +456,7 @@ public function getProperties() /** * {@inheritDoc} */ + #[\Override] public function getProperty($name) { return $this->properties[$name]; @@ -459,6 +465,7 @@ public function getProperty($name) /** * {@inheritDoc} */ + #[\Override] public function getPropertyNames() { $result = []; @@ -472,6 +479,7 @@ public function getPropertyNames() /** * {@inheritDoc} */ + #[\Override] public function getConditionsFor($name) { $property = $this->propertyMap2[$name]; @@ -482,6 +490,7 @@ public function getConditionsFor($name) /** * {@inheritDoc} */ + #[\Override] public function getGroupingAndSorting() { return $this->groupSort; @@ -492,6 +501,7 @@ public function getGroupingAndSorting() * * @throws \RuntimeException When the instance could not be retrieved. */ + #[\Override] public function getMetaModel() { /** @psalm-suppress DocblockTypeContradiction */ @@ -515,6 +525,7 @@ public function getMetaModel() /** * {@inheritDoc} */ + #[\Override] public function getIcon() { // Determine image to use. @@ -528,6 +539,7 @@ public function getIcon() /** * {@inheritDoc} */ + #[\Override] public function getBackendSection() { return trim($this->data['backendsection'] ?? ''); @@ -536,6 +548,7 @@ public function getBackendSection() /** * {@inheritDoc} */ + #[\Override] public function getBackendCaption() { return StringUtil::deserialize($this->data['backendcaption'] ?? [], true); @@ -544,6 +557,7 @@ public function getBackendCaption() /** * {@inheritDoc} */ + #[\Override] public function getParentTable() { return $this->data['ptable'] ?? null; @@ -552,6 +566,7 @@ public function getParentTable() /** * {@inheritDoc} */ + #[\Override] public function isStandalone() { return $this->data['rendertype'] == 'standalone'; @@ -560,6 +575,7 @@ public function isStandalone() /** * {@inheritDoc} */ + #[\Override] public function getRenderMode() { // If we have variant overwrite all modes and set mode 5 - tree mode. @@ -574,6 +590,7 @@ public function getRenderMode() /** * {@inheritDoc} */ + #[\Override] public function isHierarchical() { return $this->getRenderMode() === 'hierarchical'; @@ -582,6 +599,7 @@ public function isHierarchical() /** * {@inheritDoc} */ + #[\Override] public function isParented() { return $this->getRenderMode() === 'parented'; @@ -590,6 +608,7 @@ public function isParented() /** * {@inheritDoc} */ + #[\Override] public function isFlat() { return $this->getRenderMode() === 'flat'; @@ -598,6 +617,7 @@ public function isFlat() /** * {@inheritDoc} */ + #[\Override] public function isEditable() { return (bool) $this->data['iseditable']; @@ -606,6 +626,7 @@ public function isEditable() /** * {@inheritDoc} */ + #[\Override] public function isCreatable() { return (bool) $this->data['iscreatable']; @@ -614,6 +635,7 @@ public function isCreatable() /** * {@inheritDoc} */ + #[\Override] public function isDeletable() { return (bool) $this->data['isdeleteable']; @@ -622,6 +644,7 @@ public function isDeletable() /** * {@inheritDoc} */ + #[\Override] public function getPanelLayout() { return $this->data['panelLayout'] ?? ''; @@ -630,6 +653,7 @@ public function getPanelLayout() /** * {@inheritDoc} */ + #[\Override] public function isShowColumns() { return (bool) $this->data['showColumns']; diff --git a/src/BackendIntegration/InputScreen/InputScreenGroupingAndSorting.php b/src/BackendIntegration/InputScreen/InputScreenGroupingAndSorting.php index e73fbee3c..c94fc5ef4 100644 --- a/src/BackendIntegration/InputScreen/InputScreenGroupingAndSorting.php +++ b/src/BackendIntegration/InputScreen/InputScreenGroupingAndSorting.php @@ -61,6 +61,7 @@ public function __construct($data, IInputScreen $inputScreen) /** * {@inheritDoc} */ + #[\Override] public function getMetaModel() { return $this->inputScreen->getMetaModel(); @@ -69,6 +70,7 @@ public function getMetaModel() /** * {@inheritDoc} */ + #[\Override] public function getRenderGroupType() { if ($this->isManualSorting()) { @@ -81,6 +83,7 @@ public function getRenderGroupType() /** * {@inheritDoc} */ + #[\Override] public function getRenderGroupLength() { return (string) $this->data['rendergrouplen']; @@ -89,6 +92,7 @@ public function getRenderGroupLength() /** * {@inheritDoc} */ + #[\Override] public function getRenderGroupAttribute() { if (!empty($this->data['rendergroupattr'])) { @@ -105,6 +109,7 @@ public function getRenderGroupAttribute() /** * {@inheritDoc} */ + #[\Override] public function getRenderSortDirection() { return $this->data['rendersort']; @@ -113,6 +118,7 @@ public function getRenderSortDirection() /** * {@inheritDoc} */ + #[\Override] public function getRenderSortAttribute() { if (!empty($this->data['rendersortattr'])) { @@ -129,6 +135,7 @@ public function getRenderSortAttribute() /** * {@inheritDoc} */ + #[\Override] public function isManualSorting() { return (bool) $this->data['ismanualsort']; @@ -137,6 +144,7 @@ public function isManualSorting() /** * {@inheritDoc} */ + #[\Override] public function isDefault() { return (bool) $this->data['isdefault']; @@ -145,6 +153,7 @@ public function isDefault() /** * {@inheritDoc} */ + #[\Override] public function getName() { return $this->data['name']; diff --git a/src/BackendIntegration/ViewCombinations.php b/src/BackendIntegration/ViewCombinations.php index 679fc18aa..4ede6d822 100644 --- a/src/BackendIntegration/ViewCombinations.php +++ b/src/BackendIntegration/ViewCombinations.php @@ -41,6 +41,7 @@ class ViewCombinations extends \MetaModels\Helper\ViewCombinations * * @return bool */ + #[\Override] protected function authenticateUser() { $scopeMatcher = System::getContainer()->get('cca.dc-general.scope-matcher'); @@ -71,6 +72,7 @@ protected function authenticateUser() /** * {@inheritdoc} */ + #[\Override] protected function getUserGroups() { // Try to get the group(s) diff --git a/src/CoreBundle/BackendHelp/CustomSqlHelpTextProvider.php b/src/CoreBundle/BackendHelp/CustomSqlHelpTextProvider.php index df98d4e14..e243d3503 100644 --- a/src/CoreBundle/BackendHelp/CustomSqlHelpTextProvider.php +++ b/src/CoreBundle/BackendHelp/CustomSqlHelpTextProvider.php @@ -16,6 +16,7 @@ public function __construct( ) { } + #[\Override] public function getHelpFor(string $table, string $property): iterable { $buffer = []; diff --git a/src/CoreBundle/BackendHelp/PanelLayoutHelpTextProvider.php b/src/CoreBundle/BackendHelp/PanelLayoutHelpTextProvider.php index 7482986e5..ef8c61027 100644 --- a/src/CoreBundle/BackendHelp/PanelLayoutHelpTextProvider.php +++ b/src/CoreBundle/BackendHelp/PanelLayoutHelpTextProvider.php @@ -16,6 +16,7 @@ public function __construct( ) { } + #[\Override] public function getHelpFor(string $table, string $property): iterable { $buffer = []; diff --git a/src/CoreBundle/BackendHelp/TlClassHelpTextProvider.php b/src/CoreBundle/BackendHelp/TlClassHelpTextProvider.php index eab7b8d9d..713fa7298 100644 --- a/src/CoreBundle/BackendHelp/TlClassHelpTextProvider.php +++ b/src/CoreBundle/BackendHelp/TlClassHelpTextProvider.php @@ -16,6 +16,7 @@ public function __construct( ) { } + #[\Override] public function getHelpFor(string $table, string $property): iterable { $buffer = []; diff --git a/src/CoreBundle/BackendHelp/TypeHelpTextProvider.php b/src/CoreBundle/BackendHelp/TypeHelpTextProvider.php index 54f000029..1cab39c3c 100644 --- a/src/CoreBundle/BackendHelp/TypeHelpTextProvider.php +++ b/src/CoreBundle/BackendHelp/TypeHelpTextProvider.php @@ -16,6 +16,7 @@ public function __construct( ) { } + #[\Override] public function getHelpFor(string $table, string $property): iterable { $buffer = []; diff --git a/src/CoreBundle/Command/SchemaValidatorCommand.php b/src/CoreBundle/Command/SchemaValidatorCommand.php index 7a4583fe3..380bafac6 100644 --- a/src/CoreBundle/Command/SchemaValidatorCommand.php +++ b/src/CoreBundle/Command/SchemaValidatorCommand.php @@ -60,12 +60,14 @@ public function __construct( parent::__construct('metamodels:schema-update'); } + #[\Override] protected function configure(): void { parent::configure(); $this->addOption('force', null, InputOption::VALUE_NONE, 'Perform the update'); } + #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { $this->generator->generate($information = new SchemaInformation(), $this->collector->getCollection()); diff --git a/src/CoreBundle/Contao/Picker/InsertTagIdTranscoder.php b/src/CoreBundle/Contao/Picker/InsertTagIdTranscoder.php index 91cce2d5b..710deb6ce 100644 --- a/src/CoreBundle/Contao/Picker/InsertTagIdTranscoder.php +++ b/src/CoreBundle/Contao/Picker/InsertTagIdTranscoder.php @@ -16,6 +16,7 @@ public function __construct( ) { } + #[\Override] public function encode(string $id): string { return strtr( @@ -28,6 +29,7 @@ public function encode(string $id): string ); } + #[\Override] public function decode(string $encodedId): string { if ( diff --git a/src/CoreBundle/Contao/Picker/MetaModelsJumpToPickerProvider.php b/src/CoreBundle/Contao/Picker/MetaModelsJumpToPickerProvider.php index 684c1c383..25981feec 100644 --- a/src/CoreBundle/Contao/Picker/MetaModelsJumpToPickerProvider.php +++ b/src/CoreBundle/Contao/Picker/MetaModelsJumpToPickerProvider.php @@ -30,16 +30,19 @@ public function __construct( ) { } + #[\Override] public function getName(): string { return 'metamodelPicker_' . $this->tableName . '_' . $this->renderSettingId; } + #[\Override] public function getUrl(PickerConfig $config): ?string { return $this->generateUrl($config); } + #[\Override] public function createMenuItem(PickerConfig $config): ItemInterface { $label = $this->translator->trans('name', [], $this->tableName); @@ -57,11 +60,13 @@ public function createMenuItem(PickerConfig $config): ItemInterface ]); } + #[\Override] public function supportsContext(string $context): bool { return 'link' === $context; } + #[\Override] public function supportsValue(PickerConfig $config): bool { try { @@ -73,12 +78,14 @@ public function supportsValue(PickerConfig $config): bool return true; } + #[\Override] public function isCurrent(PickerConfig $config): bool { return $config->getCurrent() === $this->getName(); } /** @SuppressWarnings(PHPMD.UnusedFormalParameter) */ + #[\Override] public function createIdTranscoder(PickerConfig $config): IdTranscoderInterface { return new InsertTagIdTranscoder($this->tableName, $this->renderSettingId); diff --git a/src/CoreBundle/ContaoManager/Plugin.php b/src/CoreBundle/ContaoManager/Plugin.php index 1a4d47b95..395a7844a 100644 --- a/src/CoreBundle/ContaoManager/Plugin.php +++ b/src/CoreBundle/ContaoManager/Plugin.php @@ -41,6 +41,7 @@ class Plugin implements BundlePluginInterface, RoutingPluginInterface /** * {@inheritdoc} */ + #[\Override] public function getBundles(ParserInterface $parser): array { return [ @@ -59,6 +60,7 @@ public function getBundles(ParserInterface $parser): array /** * {@inheritdoc} */ + #[\Override] public function getRouteCollection(LoaderResolverInterface $resolver, KernelInterface $kernel): ?RouteCollection { if (false === ($resolved = $resolver->resolve(__DIR__ . '/../Resources/config/routing.yml'))) { diff --git a/src/CoreBundle/Controller/Backend/InputScreenAddAllController.php b/src/CoreBundle/Controller/Backend/InputScreenAddAllController.php index 28fa3f081..d8d5d80c6 100644 --- a/src/CoreBundle/Controller/Backend/InputScreenAddAllController.php +++ b/src/CoreBundle/Controller/Backend/InputScreenAddAllController.php @@ -100,6 +100,7 @@ public function __invoke($metaModel, $inputScreen, Request $request) * * @return array */ + #[\Override] protected function renderOutput($table, $metaModel, Request $request) { return \array_merge( @@ -121,6 +122,7 @@ protected function renderOutput($table, $metaModel, Request $request) * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ + #[\Override] protected function createEmptyDataFor(IAttribute $attribute, $parentId, $activate, $sort, $tlclass = '') { return [ @@ -141,6 +143,7 @@ protected function createEmptyDataFor(IAttribute $attribute, $parentId, $activat * * @return bool */ + #[\Override] protected function accepts(IAttribute $attribute) { return !($attribute instanceof IInternal) && !empty($attribute->get('id')); diff --git a/src/CoreBundle/Controller/Backend/RenderSettingAddAllController.php b/src/CoreBundle/Controller/Backend/RenderSettingAddAllController.php index 67b4a75f5..6dfdfbfba 100644 --- a/src/CoreBundle/Controller/Backend/RenderSettingAddAllController.php +++ b/src/CoreBundle/Controller/Backend/RenderSettingAddAllController.php @@ -52,6 +52,7 @@ public function __invoke($metaModel, $renderSetting, Request $request) * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ + #[\Override] protected function createEmptyDataFor(IAttribute $attribute, $parentId, $activate, $sort, $tlclass = '') { $result = [ @@ -76,6 +77,7 @@ protected function createEmptyDataFor(IAttribute $attribute, $parentId, $activat * * @return bool */ + #[\Override] protected function accepts(IAttribute $attribute) { return !($attribute instanceof IInternal) && !empty($attribute->get('id')); diff --git a/src/CoreBundle/Controller/ContentElement/ItemListController.php b/src/CoreBundle/Controller/ContentElement/ItemListController.php index 25a722908..e1f25becd 100644 --- a/src/CoreBundle/Controller/ContentElement/ItemListController.php +++ b/src/CoreBundle/Controller/ContentElement/ItemListController.php @@ -54,6 +54,7 @@ final class ItemListController extends AbstractContentElementController * * @return Response The response. */ + #[\Override] public function __invoke( Request $request, ContentModel $model, @@ -84,6 +85,7 @@ public function __invoke( * * @psalm-suppress DeprecatedClass */ + #[\Override] protected function getResponse(Template $template, ContentModel $model, Request $request): Response { $response = $this->getResponseInternal($template, $model, $request); diff --git a/src/CoreBundle/Controller/FrontendModule/ItemListController.php b/src/CoreBundle/Controller/FrontendModule/ItemListController.php index e0cf96197..9754b2f25 100644 --- a/src/CoreBundle/Controller/FrontendModule/ItemListController.php +++ b/src/CoreBundle/Controller/FrontendModule/ItemListController.php @@ -53,6 +53,7 @@ final class ItemListController extends AbstractFrontendModuleController * * @return Response The response. */ + #[\Override] public function __invoke( Request $request, ModuleModel $model, @@ -79,6 +80,7 @@ public function __invoke( * * @return Response The response. */ + #[\Override] protected function getBackendWildcard(ModuleModel $module): Response { /** @psalm-suppress InternalMethod - Class Adapter is internal, not the __call() method. Blame Contao. */ @@ -102,6 +104,7 @@ protected function getBackendWildcard(ModuleModel $module): Response * * @psalm-suppress DeprecatedClass */ + #[\Override] protected function getResponse(Template $template, ModuleModel $model, Request $request): Response { return $this->getResponseInternal($template, $model, $request); diff --git a/src/CoreBundle/DcGeneral/AbstractPropertyConditionChainFactory.php b/src/CoreBundle/DcGeneral/AbstractPropertyConditionChainFactory.php index 6a8dff6e2..ec5a89779 100644 --- a/src/CoreBundle/DcGeneral/AbstractPropertyConditionChainFactory.php +++ b/src/CoreBundle/DcGeneral/AbstractPropertyConditionChainFactory.php @@ -47,6 +47,7 @@ public function __construct(PropertyConditionFactory $factory) /** * {@inheritDoc} */ + #[\Override] public function buildCondition(array $configuration, IMetaModel $metaModel) { $children = []; @@ -71,6 +72,7 @@ abstract protected function createCondition(array $children); /** * {@inheritDoc} */ + #[\Override] public function maxChildren() { return -1; diff --git a/src/CoreBundle/DcGeneral/AbstractRestrictedAttributeConditionFactory.php b/src/CoreBundle/DcGeneral/AbstractRestrictedAttributeConditionFactory.php index 79641839a..fcfaa0d97 100644 --- a/src/CoreBundle/DcGeneral/AbstractRestrictedAttributeConditionFactory.php +++ b/src/CoreBundle/DcGeneral/AbstractRestrictedAttributeConditionFactory.php @@ -47,6 +47,7 @@ public function __construct(array $supportedAttributeTypes) /** * {@inheritDoc} */ + #[\Override] public function supportsAttribute($attribute) { return \in_array($attribute, $this->supportedAttributeTypes, true); diff --git a/src/CoreBundle/DcGeneral/AndPropertyConditionFactory.php b/src/CoreBundle/DcGeneral/AndPropertyConditionFactory.php index 8128a4e5c..c48da26fe 100644 --- a/src/CoreBundle/DcGeneral/AndPropertyConditionFactory.php +++ b/src/CoreBundle/DcGeneral/AndPropertyConditionFactory.php @@ -29,6 +29,7 @@ class AndPropertyConditionFactory extends AbstractPropertyConditionChainFactory /** * {@inheritDoc} */ + #[\Override] protected function createCondition(array $children) { return new PropertyConditionChain($children, PropertyConditionChain::AND_CONJUNCTION); diff --git a/src/CoreBundle/DcGeneral/NotConditionFactory.php b/src/CoreBundle/DcGeneral/NotConditionFactory.php index 631405c4e..0efe25abe 100644 --- a/src/CoreBundle/DcGeneral/NotConditionFactory.php +++ b/src/CoreBundle/DcGeneral/NotConditionFactory.php @@ -50,6 +50,7 @@ public function __construct(PropertyConditionFactory $factory) * * @throws \InvalidArgumentException When there are more than one children. */ + #[\Override] public function buildCondition(array $configuration, IMetaModel $metaModel) { // No children, then return "true". @@ -68,6 +69,7 @@ public function buildCondition(array $configuration, IMetaModel $metaModel) * * @return int */ + #[\Override] public function maxChildren() { return 1; diff --git a/src/CoreBundle/DcGeneral/OrPropertyConditionFactory.php b/src/CoreBundle/DcGeneral/OrPropertyConditionFactory.php index abe226995..3f30dd415 100644 --- a/src/CoreBundle/DcGeneral/OrPropertyConditionFactory.php +++ b/src/CoreBundle/DcGeneral/OrPropertyConditionFactory.php @@ -29,6 +29,7 @@ class OrPropertyConditionFactory extends AbstractPropertyConditionChainFactory /** * {@inheritDoc} */ + #[\Override] protected function createCondition(array $children) { return new PropertyConditionChain($children, PropertyConditionChain::OR_CONJUNCTION); diff --git a/src/CoreBundle/DcGeneral/PropertyContainAnyOfConditionFactory.php b/src/CoreBundle/DcGeneral/PropertyContainAnyOfConditionFactory.php index dfee50266..1505380da 100644 --- a/src/CoreBundle/DcGeneral/PropertyContainAnyOfConditionFactory.php +++ b/src/CoreBundle/DcGeneral/PropertyContainAnyOfConditionFactory.php @@ -33,6 +33,7 @@ class PropertyContainAnyOfConditionFactory extends AbstractRestrictedAttributeCo /** * {@inheritDoc} */ + #[\Override] public function buildCondition(array $configuration, IMetaModel $metaModel) { $condition = new PropertyContainAnyOfCondition( diff --git a/src/CoreBundle/DcGeneral/PropertyValueConditionFactory.php b/src/CoreBundle/DcGeneral/PropertyValueConditionFactory.php index 441a4d599..343d64915 100644 --- a/src/CoreBundle/DcGeneral/PropertyValueConditionFactory.php +++ b/src/CoreBundle/DcGeneral/PropertyValueConditionFactory.php @@ -32,6 +32,7 @@ class PropertyValueConditionFactory extends AbstractRestrictedAttributeCondition /** * {@inheritDoc} */ + #[\Override] public function buildCondition(array $configuration, IMetaModel $metaModel) { return new PropertyValueCondition( diff --git a/src/CoreBundle/DcGeneral/PropertyVisibleConditionFactory.php b/src/CoreBundle/DcGeneral/PropertyVisibleConditionFactory.php index 462b988cb..96520cb6d 100644 --- a/src/CoreBundle/DcGeneral/PropertyVisibleConditionFactory.php +++ b/src/CoreBundle/DcGeneral/PropertyVisibleConditionFactory.php @@ -30,6 +30,7 @@ class PropertyVisibleConditionFactory extends AbstractAttributeConditionFactory /** * {@inheritDoc} */ + #[\Override] public function buildCondition(array $configuration, IMetaModel $metaModel) { return new PropertyVisibleCondition($this->attributeIdToName($metaModel, $configuration['attr_id'])); @@ -38,6 +39,7 @@ public function buildCondition(array $configuration, IMetaModel $metaModel) /** * {@inheritDoc} */ + #[\Override] public function supportsAttribute($attribute) { return true; diff --git a/src/CoreBundle/DependencyInjection/CompilerPass/CollectDoctrineSchemaGeneratorsPass.php b/src/CoreBundle/DependencyInjection/CompilerPass/CollectDoctrineSchemaGeneratorsPass.php index d4493a479..0ed169f5a 100644 --- a/src/CoreBundle/DependencyInjection/CompilerPass/CollectDoctrineSchemaGeneratorsPass.php +++ b/src/CoreBundle/DependencyInjection/CompilerPass/CollectDoctrineSchemaGeneratorsPass.php @@ -38,6 +38,7 @@ class CollectDoctrineSchemaGeneratorsPass implements CompilerPassInterface /** * {@inheritDoc} */ + #[\Override] public function process(ContainerBuilder $container): void { $generator = $container->getDefinition(DoctrineSchemaGenerator::class); diff --git a/src/CoreBundle/DependencyInjection/CompilerPass/CollectFactoriesPass.php b/src/CoreBundle/DependencyInjection/CompilerPass/CollectFactoriesPass.php index a43d7453a..fc93ca856 100644 --- a/src/CoreBundle/DependencyInjection/CompilerPass/CollectFactoriesPass.php +++ b/src/CoreBundle/DependencyInjection/CompilerPass/CollectFactoriesPass.php @@ -48,6 +48,7 @@ class CollectFactoriesPass implements CompilerPassInterface /** * {@inheritDoc} */ + #[\Override] public function process(ContainerBuilder $container): void { $this->collectAttributeFactories($container); diff --git a/src/CoreBundle/DependencyInjection/CompilerPass/CollectSchemaGeneratorsPass.php b/src/CoreBundle/DependencyInjection/CompilerPass/CollectSchemaGeneratorsPass.php index 6bf79dfa5..6144ef070 100644 --- a/src/CoreBundle/DependencyInjection/CompilerPass/CollectSchemaGeneratorsPass.php +++ b/src/CoreBundle/DependencyInjection/CompilerPass/CollectSchemaGeneratorsPass.php @@ -38,6 +38,7 @@ class CollectSchemaGeneratorsPass implements CompilerPassInterface /** * {@inheritDoc} */ + #[\Override] public function process(ContainerBuilder $container): void { $generator = $container->getDefinition(SchemaGenerator::class); diff --git a/src/CoreBundle/DependencyInjection/CompilerPass/CollectSchemaManagersPass.php b/src/CoreBundle/DependencyInjection/CompilerPass/CollectSchemaManagersPass.php index e76815c52..084e53f4e 100644 --- a/src/CoreBundle/DependencyInjection/CompilerPass/CollectSchemaManagersPass.php +++ b/src/CoreBundle/DependencyInjection/CompilerPass/CollectSchemaManagersPass.php @@ -38,6 +38,7 @@ class CollectSchemaManagersPass implements CompilerPassInterface /** * {@inheritDoc} */ + #[\Override] public function process(ContainerBuilder $container): void { $generator = $container->getDefinition(SchemaManager::class); diff --git a/src/CoreBundle/DependencyInjection/CompilerPass/PrepareTranslatorPass.php b/src/CoreBundle/DependencyInjection/CompilerPass/PrepareTranslatorPass.php index fe5f5886b..61194694d 100644 --- a/src/CoreBundle/DependencyInjection/CompilerPass/PrepareTranslatorPass.php +++ b/src/CoreBundle/DependencyInjection/CompilerPass/PrepareTranslatorPass.php @@ -39,6 +39,7 @@ final class PrepareTranslatorPass implements CompilerPassInterface public const TAG_NAME = 'metamodels.translation-loader'; + #[\Override] public function process(ContainerBuilder $container): void { $definition = $container->getDefinition('translator.default'); diff --git a/src/CoreBundle/DependencyInjection/Configuration.php b/src/CoreBundle/DependencyInjection/Configuration.php index 5e85de509..aa518ef4f 100644 --- a/src/CoreBundle/DependencyInjection/Configuration.php +++ b/src/CoreBundle/DependencyInjection/Configuration.php @@ -64,6 +64,7 @@ public function __construct($debug, $rootDir) * * @psalm-suppress UndefinedMethod */ + #[\Override] public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('metamodels'); diff --git a/src/CoreBundle/DependencyInjection/MetaModelsCoreExtension.php b/src/CoreBundle/DependencyInjection/MetaModelsCoreExtension.php index 632a258c5..9e5fe39ab 100644 --- a/src/CoreBundle/DependencyInjection/MetaModelsCoreExtension.php +++ b/src/CoreBundle/DependencyInjection/MetaModelsCoreExtension.php @@ -87,6 +87,7 @@ class MetaModelsCoreExtension extends Extension implements PrependExtensionInter /** * {@inheritDoc} */ + #[\Override] public function prepend(ContainerBuilder $container): void { $this->collectDefaultTableOptionsFromDoctrineExtension($container); @@ -95,6 +96,7 @@ public function prepend(ContainerBuilder $container): void /** * {@inheritDoc} */ + #[\Override] public function load(array $configs, ContainerBuilder $container): void { $container->registerAttributeForAutoconfiguration( @@ -134,6 +136,7 @@ static function (ChildDefinition $definition, DoctrineSchemaProvider $attribute) /** * {@inheritdoc} */ + #[\Override] public function getConfiguration(array $config, ContainerBuilder $container): ?ConfigurationInterface { $projectDir = $container->getParameter('kernel.project_dir'); diff --git a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbAttributeListener.php b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbAttributeListener.php index 9654f0e6c..e1d7efc3a 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbAttributeListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbAttributeListener.php @@ -38,6 +38,7 @@ class BreadcrumbAttributeListener extends AbstractBreadcrumbListener /** * {@inheritDoc} */ + #[\Override] protected function wantToHandle(GetBreadcrumbEvent $event) { $dataDefinition = $event->getEnvironment()->getDataDefinition(); @@ -49,6 +50,7 @@ protected function wantToHandle(GetBreadcrumbEvent $event) /** * {@inheritDoc} */ + #[\Override] protected function getBreadcrumbElements(EnvironmentInterface $environment, BreadcrumbStore $elements) { if (!$elements->hasId('tl_metamodel')) { diff --git a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbDcaCombineListener.php b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbDcaCombineListener.php index 5bca1e18f..664baa56c 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbDcaCombineListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbDcaCombineListener.php @@ -38,6 +38,7 @@ class BreadcrumbDcaCombineListener extends AbstractBreadcrumbListener /** * {@inheritDoc} */ + #[\Override] protected function wantToHandle(GetBreadcrumbEvent $event) { $dataDefinition = $event->getEnvironment()->getDataDefinition(); @@ -49,6 +50,7 @@ protected function wantToHandle(GetBreadcrumbEvent $event) /** * {@inheritDoc} */ + #[\Override] protected function getBreadcrumbElements(EnvironmentInterface $environment, BreadcrumbStore $elements) { if (!$elements->hasId('tl_metamodel')) { diff --git a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbDcaListener.php b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbDcaListener.php index 2b277e82e..97b485530 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbDcaListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbDcaListener.php @@ -39,6 +39,7 @@ class BreadcrumbDcaListener extends AbstractBreadcrumbListener /** * {@inheritDoc} */ + #[\Override] protected function wantToHandle(GetBreadcrumbEvent $event) { $dataDefinition = $event->getEnvironment()->getDataDefinition(); @@ -50,6 +51,7 @@ protected function wantToHandle(GetBreadcrumbEvent $event) /** * {@inheritDoc} */ + #[\Override] protected function getBreadcrumbElements(EnvironmentInterface $environment, BreadcrumbStore $elements) { if (!$elements->hasId('tl_metamodel')) { diff --git a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbDcaSettingConditionListener.php b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbDcaSettingConditionListener.php index 5d904188e..8d8520287 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbDcaSettingConditionListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbDcaSettingConditionListener.php @@ -42,6 +42,7 @@ class BreadcrumbDcaSettingConditionListener extends AbstractBreadcrumbListener /** * {@inheritDoc} */ + #[\Override] protected function wantToHandle(GetBreadcrumbEvent $event) { $dataDefinition = $event->getEnvironment()->getDataDefinition(); @@ -53,6 +54,7 @@ protected function wantToHandle(GetBreadcrumbEvent $event) /** * {@inheritDoc} */ + #[\Override] protected function getBreadcrumbElements(EnvironmentInterface $environment, BreadcrumbStore $elements) { if (!$elements->hasId('tl_metamodel_dcasetting')) { diff --git a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbDcaSettingListener.php b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbDcaSettingListener.php index 64ebb5acb..0d153bb5a 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbDcaSettingListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbDcaSettingListener.php @@ -38,6 +38,7 @@ class BreadcrumbDcaSettingListener extends AbstractBreadcrumbListener /** * {@inheritDoc} */ + #[\Override] protected function wantToHandle(GetBreadcrumbEvent $event) { $dataDefinition = $event->getEnvironment()->getDataDefinition(); @@ -49,6 +50,7 @@ protected function wantToHandle(GetBreadcrumbEvent $event) /** * {@inheritDoc} */ + #[\Override] protected function getBreadcrumbElements(EnvironmentInterface $environment, BreadcrumbStore $elements) { if (!$elements->hasId('tl_metamodel_dca')) { diff --git a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbDcaSortGroupListener.php b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbDcaSortGroupListener.php index 9365d470d..86aecf26f 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbDcaSortGroupListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbDcaSortGroupListener.php @@ -38,6 +38,7 @@ class BreadcrumbDcaSortGroupListener extends AbstractBreadcrumbListener /** * {@inheritDoc} */ + #[\Override] protected function wantToHandle(GetBreadcrumbEvent $event) { $dataDefinition = $event->getEnvironment()->getDataDefinition(); @@ -49,6 +50,7 @@ protected function wantToHandle(GetBreadcrumbEvent $event) /** * {@inheritDoc} */ + #[\Override] protected function getBreadcrumbElements(EnvironmentInterface $environment, BreadcrumbStore $elements) { if (!$elements->hasId('tl_metamodel_dca')) { diff --git a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbFilterListener.php b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbFilterListener.php index 002a9b177..72465547f 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbFilterListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbFilterListener.php @@ -39,6 +39,7 @@ class BreadcrumbFilterListener extends AbstractBreadcrumbListener /** * {@inheritDoc} */ + #[\Override] protected function wantToHandle(GetBreadcrumbEvent $event) { $dataDefinition = $event->getEnvironment()->getDataDefinition(); @@ -50,6 +51,7 @@ protected function wantToHandle(GetBreadcrumbEvent $event) /** * {@inheritDoc} */ + #[\Override] protected function getBreadcrumbElements(EnvironmentInterface $environment, BreadcrumbStore $elements) { if (!$elements->hasId('tl_metamodel')) { diff --git a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbFilterSettingListener.php b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbFilterSettingListener.php index 56683d5a9..088e8420c 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbFilterSettingListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbFilterSettingListener.php @@ -38,6 +38,7 @@ class BreadcrumbFilterSettingListener extends AbstractBreadcrumbListener /** * {@inheritDoc} */ + #[\Override] protected function wantToHandle(GetBreadcrumbEvent $event) { $dataDefinition = $event->getEnvironment()->getDataDefinition(); @@ -49,6 +50,7 @@ protected function wantToHandle(GetBreadcrumbEvent $event) /** * {@inheritDoc} */ + #[\Override] protected function getBreadcrumbElements(EnvironmentInterface $environment, BreadcrumbStore $elements) { if (!$elements->hasId('tl_metamodel_filter')) { diff --git a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbMetaModelListener.php b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbMetaModelListener.php index e7c6a49d7..a72cc4463 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbMetaModelListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbMetaModelListener.php @@ -37,6 +37,7 @@ class BreadcrumbMetaModelListener extends AbstractBreadcrumbListener /** * {@inheritDoc} */ + #[\Override] protected function wantToHandle(GetBreadcrumbEvent $event) { $dataDefinition = $event->getEnvironment()->getDataDefinition(); @@ -48,6 +49,7 @@ protected function wantToHandle(GetBreadcrumbEvent $event) /** * {@inheritDoc} */ + #[\Override] protected function getBreadcrumbElements(EnvironmentInterface $environment, BreadcrumbStore $elements) { $elements->push( diff --git a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbRenderSettingListener.php b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbRenderSettingListener.php index 15911c661..004a096d6 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbRenderSettingListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbRenderSettingListener.php @@ -38,6 +38,7 @@ class BreadcrumbRenderSettingListener extends AbstractBreadcrumbListener /** * {@inheritDoc} */ + #[\Override] protected function wantToHandle(GetBreadcrumbEvent $event) { $dataDefinition = $event->getEnvironment()->getDataDefinition(); @@ -49,6 +50,7 @@ protected function wantToHandle(GetBreadcrumbEvent $event) /** * {@inheritDoc} */ + #[\Override] public function getBreadcrumbElements(EnvironmentInterface $environment, BreadcrumbStore $elements) { if (!$elements->hasId('tl_metamodel_rendersettings')) { diff --git a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbRenderSettingsListener.php b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbRenderSettingsListener.php index 086ba853e..f3c72d3c3 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbRenderSettingsListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbRenderSettingsListener.php @@ -39,6 +39,7 @@ class BreadcrumbRenderSettingsListener extends AbstractBreadcrumbListener /** * {@inheritDoc} */ + #[\Override] protected function wantToHandle(GetBreadcrumbEvent $event) { $dataDefinition = $event->getEnvironment()->getDataDefinition(); @@ -50,6 +51,7 @@ protected function wantToHandle(GetBreadcrumbEvent $event) /** * {@inheritDoc} */ + #[\Override] protected function getBreadcrumbElements(EnvironmentInterface $environment, BreadcrumbStore $elements) { if (!$elements->hasId('tl_metamodel')) { diff --git a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbSearchablePagesListener.php b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbSearchablePagesListener.php index 3cb6bbf49..cda2b20f9 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbSearchablePagesListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Breadcrumb/BreadcrumbSearchablePagesListener.php @@ -39,6 +39,7 @@ class BreadcrumbSearchablePagesListener extends AbstractBreadcrumbListener /** * {@inheritDoc} */ + #[\Override] protected function wantToHandle(GetBreadcrumbEvent $event) { $dataDefinition = $event->getEnvironment()->getDataDefinition(); @@ -50,6 +51,7 @@ protected function wantToHandle(GetBreadcrumbEvent $event) /** * {@inheritDoc} */ + #[\Override] protected function getBreadcrumbElements(EnvironmentInterface $environment, BreadcrumbStore $elements) { if (!$elements->hasId('tl_metamodel')) { diff --git a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/BasicDefinitionBuilder.php b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/BasicDefinitionBuilder.php index 5390dcbfc..571812b22 100644 --- a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/BasicDefinitionBuilder.php +++ b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/BasicDefinitionBuilder.php @@ -68,6 +68,7 @@ public function __construct(ViewCombination $viewCombination, IFactory $factory) * * @return void */ + #[\Override] protected function build(IMetaModelDataDefinition $container) { $inputScreen = $this->viewCombination->getScreen($container->getName()); diff --git a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/CommandBuilder.php b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/CommandBuilder.php index 233ef2ccf..7f8b714e7 100644 --- a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/CommandBuilder.php +++ b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/CommandBuilder.php @@ -122,6 +122,7 @@ public function __construct( * * @return void */ + #[\Override] protected function build(IMetaModelDataDefinition $container) { if ($container->hasDefinition(Contao2BackendViewDefinitionInterface::NAME)) { diff --git a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/ConditionBuilderWithVariants.php b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/ConditionBuilderWithVariants.php index df30a3f5e..c2e9782a5 100644 --- a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/ConditionBuilderWithVariants.php +++ b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/ConditionBuilderWithVariants.php @@ -38,6 +38,7 @@ class ConditionBuilderWithVariants extends AbstractConditionBuilder * * @return void */ + #[\Override] protected function calculate(): void { // Basic conditions. diff --git a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/ConditionBuilderWithoutVariants.php b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/ConditionBuilderWithoutVariants.php index e86f84e3e..d4a753ea1 100644 --- a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/ConditionBuilderWithoutVariants.php +++ b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/ConditionBuilderWithoutVariants.php @@ -40,6 +40,7 @@ class ConditionBuilderWithoutVariants extends AbstractConditionBuilder * * @throws \RuntimeException When the conditions can not be determined yet. */ + #[\Override] protected function calculate(): void { if ($this->inputScreen['meta']['rendertype'] !== 'standalone') { diff --git a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/Contao2BackendViewDefinitionBuilder.php b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/Contao2BackendViewDefinitionBuilder.php index b233a41ef..3a6e4b254 100644 --- a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/Contao2BackendViewDefinitionBuilder.php +++ b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/Contao2BackendViewDefinitionBuilder.php @@ -131,6 +131,7 @@ public function __construct( * * @return void */ + #[\Override] protected function build(IMetaModelDataDefinition $container) { $this->container = $container; diff --git a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/DataProviderBuilder.php b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/DataProviderBuilder.php index 8d819725a..fa2d43846 100644 --- a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/DataProviderBuilder.php +++ b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/DataProviderBuilder.php @@ -70,6 +70,7 @@ public function __construct(ViewCombination $viewCombination, IFactory $factory) * * @return void */ + #[\Override] protected function build(IMetaModelDataDefinition $container) { $inputScreen = $this->viewCombination->getScreen($container->getName()); diff --git a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/MetaModelDefinitionBuilder.php b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/MetaModelDefinitionBuilder.php index 3a3c890dc..1cfcd7557 100644 --- a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/MetaModelDefinitionBuilder.php +++ b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/MetaModelDefinitionBuilder.php @@ -57,6 +57,7 @@ public function __construct(ViewCombination $viewCombination) * * @return void */ + #[\Override] protected function build(IMetaModelDataDefinition $container) { $definition = $this->createOrGetDefinition($container); diff --git a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/PaletteBuilder.php b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/PaletteBuilder.php index 5c1593083..1dc6317c0 100644 --- a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/PaletteBuilder.php +++ b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/PaletteBuilder.php @@ -93,6 +93,7 @@ public function __construct( * * @return void */ + #[\Override] protected function build(IMetaModelDataDefinition $container) { if (null === ($inputScreen = $this->viewCombination->getScreen($container->getName()))) { diff --git a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/PanelBuilder.php b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/PanelBuilder.php index 6666361d6..00f8d1068 100644 --- a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/PanelBuilder.php +++ b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/PanelBuilder.php @@ -75,6 +75,7 @@ public function __construct(ViewCombination $viewCombination) * * @return void */ + #[\Override] protected function build(IMetaModelDataDefinition $container) { $this->inputScreen = $this->viewCombination->getScreen($container->getName()); diff --git a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/PropertyDefinitionBuilder.php b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/PropertyDefinitionBuilder.php index 271ab1a44..3b7c15fe6 100644 --- a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/PropertyDefinitionBuilder.php +++ b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/PropertyDefinitionBuilder.php @@ -90,6 +90,7 @@ public function __construct( * * @return void */ + #[\Override] protected function build(IMetaModelDataDefinition $container) { $inputScreen = $this->viewCombination->getScreen($container->getName()); diff --git a/src/CoreBundle/EventListener/DcGeneral/EnvironmentPopulator/AssetPopulator.php b/src/CoreBundle/EventListener/DcGeneral/EnvironmentPopulator/AssetPopulator.php index 9e70ad446..f60c483d6 100644 --- a/src/CoreBundle/EventListener/DcGeneral/EnvironmentPopulator/AssetPopulator.php +++ b/src/CoreBundle/EventListener/DcGeneral/EnvironmentPopulator/AssetPopulator.php @@ -41,6 +41,7 @@ class AssetPopulator * @SuppressWarnings(PHPMD.CamelCaseVariableName) * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ + #[\Override] public function populate(EnvironmentInterface $environment) { $GLOBALS['TL_CSS'][] = '/bundles/metamodelscore/css/style.css'; diff --git a/src/CoreBundle/EventListener/DcGeneral/EnvironmentPopulator/AttributePopulator.php b/src/CoreBundle/EventListener/DcGeneral/EnvironmentPopulator/AttributePopulator.php index abd9a7686..616eaa7db 100644 --- a/src/CoreBundle/EventListener/DcGeneral/EnvironmentPopulator/AttributePopulator.php +++ b/src/CoreBundle/EventListener/DcGeneral/EnvironmentPopulator/AttributePopulator.php @@ -68,6 +68,7 @@ public function __construct(EventDispatcherInterface $dispatcher, IFactory $fact * * @return void */ + #[\Override] public function populate(EnvironmentInterface $environment) { $dataDefinition = $environment->getDataDefinition(); diff --git a/src/CoreBundle/EventListener/DcGeneral/EnvironmentPopulator/DataProviderPopulator.php b/src/CoreBundle/EventListener/DcGeneral/EnvironmentPopulator/DataProviderPopulator.php index c9e80a2d5..20f045bc6 100644 --- a/src/CoreBundle/EventListener/DcGeneral/EnvironmentPopulator/DataProviderPopulator.php +++ b/src/CoreBundle/EventListener/DcGeneral/EnvironmentPopulator/DataProviderPopulator.php @@ -79,6 +79,7 @@ public function __construct(IFactory $factory, EventDispatcherInterface $dispatc * * @return void */ + #[\Override] public function populate(EnvironmentInterface $environment) { foreach ( diff --git a/src/CoreBundle/EventListener/DcGeneral/EnvironmentPopulator/TranslatorPopulator.php b/src/CoreBundle/EventListener/DcGeneral/EnvironmentPopulator/TranslatorPopulator.php index d25e151b7..46c58be07 100644 --- a/src/CoreBundle/EventListener/DcGeneral/EnvironmentPopulator/TranslatorPopulator.php +++ b/src/CoreBundle/EventListener/DcGeneral/EnvironmentPopulator/TranslatorPopulator.php @@ -64,6 +64,7 @@ public function __construct( * @SuppressWarnings(PHPMD.Superglobals) * @SuppressWarnings(PHPMD.CamelCaseVariableName) */ + #[\Override] protected function populate(EnvironmentInterface $environment) { $translator = $environment->getTranslator(); diff --git a/src/CoreBundle/EventListener/DcGeneral/Table/Attribute/GetAttributeTypeListener.php b/src/CoreBundle/EventListener/DcGeneral/Table/Attribute/GetAttributeTypeListener.php index da072cb3b..d534e5218 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Table/Attribute/GetAttributeTypeListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Table/Attribute/GetAttributeTypeListener.php @@ -122,6 +122,7 @@ public function getOptions(GetPropertyOptionsEvent $event) * * @return bool */ + #[\Override] protected function wantToHandle(AbstractEnvironmentAwareEvent $event) { /** @var GetPropertyOptionsEvent $event */ diff --git a/src/CoreBundle/EventListener/DcGeneral/Table/DcaSetting/LegendTitleListener.php b/src/CoreBundle/EventListener/DcGeneral/Table/DcaSetting/LegendTitleListener.php index 81320f09c..d8cad9891 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Table/DcaSetting/LegendTitleListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Table/DcaSetting/LegendTitleListener.php @@ -110,6 +110,7 @@ public function buildWidget(BuildWidgetEvent $event) /** * {@inheritDoc} */ + #[\Override] protected function wantToHandle(AbstractEnvironmentAwareEvent $event) { if (!parent::wantToHandle($event)) { diff --git a/src/CoreBundle/EventListener/DcGeneral/Table/DcaSetting/ModelToLabelListener.php b/src/CoreBundle/EventListener/DcGeneral/Table/DcaSetting/ModelToLabelListener.php index 1358b5818..8fa46a61f 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Table/DcaSetting/ModelToLabelListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Table/DcaSetting/ModelToLabelListener.php @@ -180,14 +180,14 @@ private function drawLegend(ModelToLabelEvent $event) assert($metaModel instanceof IMetaModel); if (\is_array($legend = StringUtil::deserialize($model->getProperty('legendtitle')))) { /** @psalm-suppress DeprecatedMethod */ - foreach ([$metaModel->getActiveLanguage(), $metaModel->getFallbackLanguage()] as $language) { - if (\array_key_exists($language ?? '', $legend) && !empty($legend[$language])) { + foreach ([$metaModel->getActiveLanguage(), (string) $metaModel->getFallbackLanguage()] as $language) { + if (\array_key_exists($language, $legend) && !empty($legend[$language])) { $legend = $legend[$language]; break; } } } - if (null === $legend) { + if (!\is_string($legend)) { $legend = 'legend'; } diff --git a/src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/AttributeIdListener.php b/src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/AttributeIdListener.php index 2a554b924..61584ab3c 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/AttributeIdListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/AttributeIdListener.php @@ -148,6 +148,7 @@ public function encodeAttributeValue(EncodePropertyValueFromWidgetEvent $event) /** * {@inheritDoc} */ + #[\Override] protected function wantToHandle(AbstractEnvironmentAwareEvent $event) { if (!parent::wantToHandle($event)) { diff --git a/src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/ModelToLabelListener.php b/src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/ModelToLabelListener.php index 0d3cf22f8..1a7eb314c 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/ModelToLabelListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/ModelToLabelListener.php @@ -120,6 +120,7 @@ public function handle(ModelToLabelEvent $event) /** * {@inheritDoc} */ + #[\Override] protected function wantToHandle(AbstractEnvironmentAwareEvent $event) { $inputProvider = $event->getEnvironment()->getInputProvider(); diff --git a/src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/TypeOptionsListener.php b/src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/TypeOptionsListener.php index d8baa556c..5c568db0e 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/TypeOptionsListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/TypeOptionsListener.php @@ -89,6 +89,7 @@ public function handle(GetPropertyOptionsEvent $event) /** * {@inheritDoc} */ + #[\Override] protected function wantToHandle(AbstractEnvironmentAwareEvent $event) { /** @var GetPropertyOptionsEvent $event */ diff --git a/src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/ValueListener.php b/src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/ValueListener.php index 93d24a085..a179eea9e 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/ValueListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/ValueListener.php @@ -198,6 +198,7 @@ public function setValueOptionsMultiple(ManipulateWidgetEvent $event) /** * {@inheritDoc} */ + #[\Override] protected function wantToHandle(AbstractEnvironmentAwareEvent $event) { if (!parent::wantToHandle($event)) { diff --git a/src/CoreBundle/EventListener/DcGeneral/Table/DcaSortGroup/AttributeOptionsListener.php b/src/CoreBundle/EventListener/DcGeneral/Table/DcaSortGroup/AttributeOptionsListener.php index 443fa685c..e4bdfe708 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Table/DcaSortGroup/AttributeOptionsListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Table/DcaSortGroup/AttributeOptionsListener.php @@ -104,6 +104,7 @@ public function handle(GetPropertyOptionsEvent $event) * * @return bool */ + #[\Override] protected function wantToHandle(AbstractEnvironmentAwareEvent $event) { /** @var GetPropertyOptionsEvent $event */ diff --git a/src/CoreBundle/EventListener/DcGeneral/Table/FilterSetting/FilterSettingTypeRendererCore.php b/src/CoreBundle/EventListener/DcGeneral/Table/FilterSetting/FilterSettingTypeRendererCore.php index 8ee714241..79eff979c 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Table/FilterSetting/FilterSettingTypeRendererCore.php +++ b/src/CoreBundle/EventListener/DcGeneral/Table/FilterSetting/FilterSettingTypeRendererCore.php @@ -34,6 +34,7 @@ class FilterSettingTypeRendererCore extends AbstractFilterSettingTypeRenderer * * @return list */ + #[\Override] protected function getTypes() { return ['idlist', 'simplelookup', 'customsql', 'conditionand', 'conditionor']; @@ -48,6 +49,7 @@ protected function getTypes() * * @return array */ + #[\Override] protected function getLabelParameters(EnvironmentInterface $environment, ModelInterface $model) { if ($model->getProperty('type') == 'simplelookup') { diff --git a/src/CoreBundle/FileUsage/MetaModelsMultipleResult.php b/src/CoreBundle/FileUsage/MetaModelsMultipleResult.php index bf74a1b58..7cfc61a86 100644 --- a/src/CoreBundle/FileUsage/MetaModelsMultipleResult.php +++ b/src/CoreBundle/FileUsage/MetaModelsMultipleResult.php @@ -36,6 +36,7 @@ public function getEditUrl(): string return $this->editUrl; } + #[\Override] public function getTemplate(): string { return '@MetaModelsCore/FileUsage/file_usage_multiple_result.html.twig'; diff --git a/src/CoreBundle/FileUsage/MetaModelsSingleResult.php b/src/CoreBundle/FileUsage/MetaModelsSingleResult.php index 8ac7cdb5c..d3b47cc00 100644 --- a/src/CoreBundle/FileUsage/MetaModelsSingleResult.php +++ b/src/CoreBundle/FileUsage/MetaModelsSingleResult.php @@ -36,6 +36,7 @@ public function getEditUrl(): string return $this->editUrl; } + #[\Override] public function getTemplate(): string { return '@MetaModelsCore/FileUsage/file_usage_single_result.html.twig'; diff --git a/src/CoreBundle/FileUsage/MetaModelsTranslatedMultipleResult.php b/src/CoreBundle/FileUsage/MetaModelsTranslatedMultipleResult.php index 4c876696d..1cac2de0d 100644 --- a/src/CoreBundle/FileUsage/MetaModelsTranslatedMultipleResult.php +++ b/src/CoreBundle/FileUsage/MetaModelsTranslatedMultipleResult.php @@ -42,6 +42,7 @@ public function getEditUrl(): string return $this->editUrl; } + #[\Override] public function getTemplate(): string { return '@MetaModelsCore/FileUsage/file_usage_translated_multiple_result.html.twig'; diff --git a/src/CoreBundle/FileUsage/MetaModelsTranslatedSingleResult.php b/src/CoreBundle/FileUsage/MetaModelsTranslatedSingleResult.php index 61118e367..7bab05258 100644 --- a/src/CoreBundle/FileUsage/MetaModelsTranslatedSingleResult.php +++ b/src/CoreBundle/FileUsage/MetaModelsTranslatedSingleResult.php @@ -42,6 +42,7 @@ public function getEditUrl(): string return $this->editUrl; } + #[\Override] public function getTemplate(): string { return '@MetaModelsCore/FileUsage/file_usage_translated_single_result.html.twig'; diff --git a/src/CoreBundle/MetaModelsCoreBundle.php b/src/CoreBundle/MetaModelsCoreBundle.php index e24495022..840f837ca 100644 --- a/src/CoreBundle/MetaModelsCoreBundle.php +++ b/src/CoreBundle/MetaModelsCoreBundle.php @@ -37,6 +37,7 @@ class MetaModelsCoreBundle extends Bundle /** * {@inheritDoc} */ + #[\Override] public function build(ContainerBuilder $container): void { parent::build($container); diff --git a/src/CoreBundle/Migration/FindClearAllTemplateMigration.php b/src/CoreBundle/Migration/FindClearAllTemplateMigration.php index 066ae4cbf..387f0757c 100644 --- a/src/CoreBundle/Migration/FindClearAllTemplateMigration.php +++ b/src/CoreBundle/Migration/FindClearAllTemplateMigration.php @@ -53,6 +53,7 @@ public function __construct(string $projectDir) * * @return string */ + #[\Override] public function getName(): string { return 'Detect old style named MetaModels filter template files (mm_filter_clearall*.*).'; @@ -64,6 +65,7 @@ public function getName(): string * * @return bool */ + #[\Override] public function shouldRun(): bool { if ($this->findClearAllTemplates()) { @@ -78,6 +80,7 @@ public function shouldRun(): bool * * @return MigrationResult */ + #[\Override] public function run(): MigrationResult { if ($this->findClearAllTemplates()) { diff --git a/src/CoreBundle/Migration/FindXhtmlTemplateMigration.php b/src/CoreBundle/Migration/FindXhtmlTemplateMigration.php index e8824bf44..bdbec0c40 100644 --- a/src/CoreBundle/Migration/FindXhtmlTemplateMigration.php +++ b/src/CoreBundle/Migration/FindXhtmlTemplateMigration.php @@ -53,6 +53,7 @@ public function __construct(string $projectDir) * * @return string */ + #[\Override] public function getName(): string { return 'Detect old MetaModels template files with extension "xhtml".'; @@ -64,6 +65,7 @@ public function getName(): string * * @return bool */ + #[\Override] public function shouldRun(): bool { if ($this->findXhtmlTemplates()) { @@ -78,6 +80,7 @@ public function shouldRun(): bool * * @return MigrationResult */ + #[\Override] public function run(): MigrationResult { if ($this->findXhtmlTemplates()) { diff --git a/src/CoreBundle/Migration/SetDefaultZeroMigration.php b/src/CoreBundle/Migration/SetDefaultZeroMigration.php index 2f2cb06fa..46290850b 100644 --- a/src/CoreBundle/Migration/SetDefaultZeroMigration.php +++ b/src/CoreBundle/Migration/SetDefaultZeroMigration.php @@ -98,6 +98,7 @@ public function __construct(Connection $connection) * * @return string */ + #[\Override] public function getName(): string { return 'Set default zero values for system columns in MetaModels.'; @@ -111,6 +112,7 @@ public function getName(): string * @return bool * @throws Exception */ + #[\Override] public function shouldRun(): bool { $nonNullableColumns = $this->fetchNonDefaultZeroColumns(); @@ -127,6 +129,7 @@ public function shouldRun(): bool * @return MigrationResult * @throws Exception */ + #[\Override] public function run(): MigrationResult { $columnsByTable = $this->fetchNonDefaultZeroColumns(); diff --git a/src/CoreBundle/Migration/TableCollationMigration.php b/src/CoreBundle/Migration/TableCollationMigration.php index 09305be63..f6ec6d1d1 100644 --- a/src/CoreBundle/Migration/TableCollationMigration.php +++ b/src/CoreBundle/Migration/TableCollationMigration.php @@ -64,6 +64,7 @@ public function __construct(Connection $connection, array $defaultTableOptions) * * @return string */ + #[\Override] public function getName(): string { return \sprintf( @@ -82,6 +83,7 @@ public function getName(): string * @return bool * @throws Exception */ + #[\Override] public function shouldRun(): bool { $tables = $this->fetchPendingTables(); @@ -98,6 +100,7 @@ public function shouldRun(): bool * @return MigrationResult * @throws Exception */ + #[\Override] public function run(): MigrationResult { $tables = $this->fetchPendingTables(); diff --git a/src/CoreBundle/Translator/MetaModelTranslationLoader.php b/src/CoreBundle/Translator/MetaModelTranslationLoader.php index 46cd07c12..d712c8b8a 100644 --- a/src/CoreBundle/Translator/MetaModelTranslationLoader.php +++ b/src/CoreBundle/Translator/MetaModelTranslationLoader.php @@ -69,6 +69,7 @@ public function __construct( * @SuppressWarnings(PHPMD.NPathComplexity) * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ + #[\Override] public function load($resource, string $locale, string $domain = 'messages'): MessageCatalogue { // Load tl_metamodel_item catalogue. diff --git a/src/CoreBundle/Translator/Translator.php b/src/CoreBundle/Translator/Translator.php index f173e918a..7d3f00851 100644 --- a/src/CoreBundle/Translator/Translator.php +++ b/src/CoreBundle/Translator/Translator.php @@ -43,6 +43,7 @@ public function __construct(TranslatorInterface&TranslatorBagInterface&LocaleAwa * Gets the translation from Contao’s $GLOBALS['TL_LANG'] array if the message * domain starts with "contao_". The locale parameter is ignored in this case. */ + #[\Override] public function trans($id, array $parameters = [], $domain = null, $locale = null): string { // Cut off the contao_ prefix for mm_ domains as they are already loaded via symfony. @@ -54,21 +55,25 @@ public function trans($id, array $parameters = [], $domain = null, $locale = nul return $this->translator->trans($id, $parameters, $domain, $locale); } + #[\Override] public function setLocale(string $locale): void { $this->translator->setLocale($locale); } + #[\Override] public function getLocale(): string { return $this->translator->getLocale(); } + #[\Override] public function getCatalogue($locale = null): MessageCatalogueInterface { return $this->translator->getCatalogue($locale); } + #[\Override] public function getCatalogues(): array { if (!method_exists($this->translator, 'getCatalogues')) { diff --git a/src/DcGeneral/Data/Driver.php b/src/DcGeneral/Data/Driver.php index 1e49cc138..cd50dc1f1 100644 --- a/src/DcGeneral/Data/Driver.php +++ b/src/DcGeneral/Data/Driver.php @@ -139,6 +139,7 @@ public function setConnection(Connection $connection) * * @throws \RuntimeException When an unusable object has been passed. */ + #[\Override] public function delete($item) { $metaModel = $this->getMetaModel(); @@ -167,6 +168,7 @@ public function delete($item) * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ + #[\Override] public function saveVersion(ModelInterface $model, $username) { throw new \RuntimeException('Versioning not supported in MetaModels so far.'); @@ -184,6 +186,7 @@ public function saveVersion(ModelInterface $model, $username) * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ + #[\Override] public function getVersion($mixID, $mixVersion) { throw new \RuntimeException('Versioning not supported in MetaModels so far.'); @@ -201,6 +204,7 @@ public function getVersion($mixID, $mixVersion) * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ + #[\Override] public function setVersionActive($mixID, $mixVersion) { throw new \RuntimeException('Versioning not supported in MetaModels so far.'); @@ -217,6 +221,7 @@ public function setVersionActive($mixID, $mixVersion) * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ + #[\Override] public function getActiveVersion($mixID) { throw new \RuntimeException('Versioning not supported in MetaModels so far.'); @@ -286,6 +291,7 @@ protected function getMetaModel() * * @return null|ModelInterface */ + #[\Override] public function fetch(ConfigInterface $config) { $backupLanguage = $this->setLanguage($currentLanguage = $this->getCurrentLanguage()); @@ -323,6 +329,7 @@ public function fetch(ConfigInterface $config) * * @throws \RuntimeException When no source has been defined. */ + #[\Override] public function setBaseConfig(array $config) { if (!$config['source']) { @@ -338,6 +345,7 @@ public function setBaseConfig(array $config) * * @return ConfigInterface */ + #[\Override] public function getEmptyConfig() { return DefaultConfig::init(); @@ -348,6 +356,7 @@ public function getEmptyConfig() * * @return ModelInterface */ + #[\Override] public function getEmptyModel() { if (!isset($this->dispatcher)) { @@ -369,6 +378,7 @@ public function getEmptyModel() * * @return CollectionInterface */ + #[\Override] public function getEmptyCollection() { return new DefaultCollection(); @@ -466,6 +476,7 @@ protected function getItemsFromFilter($filter, $config) * * @return CollectionInterface|list */ + #[\Override] public function fetchAll(ConfigInterface $config) { $backupLanguage = $this->setLanguage($this->getCurrentLanguage()); @@ -508,6 +519,7 @@ public function fetchAll(ConfigInterface $config) * * @throws \RuntimeException If improper values have been passed (i.e. not exactly one field requested). */ + #[\Override] public function getFilterOptions(ConfigInterface $config) { $arrProperties = $config->getFields(); @@ -540,6 +552,7 @@ public function getFilterOptions(ConfigInterface $config) * * @return int */ + #[\Override] public function getCount(ConfigInterface $config) { $objFilter = $this->prepareFilter($config); @@ -560,6 +573,7 @@ public function getCount(ConfigInterface $config) * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ + #[\Override] public function getVersions($mixID, $onlyActive = false) { // No version support on MetaModels so far, sorry. @@ -575,6 +589,7 @@ public function getVersions($mixID, $onlyActive = false) * * @return bool True if the values is not yet contained within the table, false otherwise. */ + #[\Override] public function isUniqueValue($field, $new, $primaryId = null) { $model = $this->getMetaModel(); @@ -612,6 +627,7 @@ public function isUniqueValue($field, $new, $primaryId = null) * * @throws \RuntimeException For invalid ids. */ + #[\Override] public function resetFallback($field) { // @codingStandardsIgnoreStart @@ -654,6 +670,7 @@ public function resetFallback($field) * * @throws \RuntimeException When an incompatible item was passed, an Exception is being thrown. */ + #[\Override] public function save(ModelInterface $item, $timestamp = null) { if (null === $timestamp) { @@ -690,6 +707,7 @@ public function save(ModelInterface $item, $timestamp = null) * * @throws \RuntimeException When an incompatible item was passed. */ + #[\Override] public function saveEach(CollectionInterface $items, $timestamp = 0) { if (null === $timestamp) { @@ -713,6 +731,7 @@ public function saveEach(CollectionInterface $items, $timestamp = 0) * * @return boolean */ + #[\Override] public function fieldExists($columnName) { return !!( @@ -731,6 +750,7 @@ public function fieldExists($columnName) * * @throws \InvalidArgumentException If not both models are compatible with this data provider. */ + #[\Override] public function sameModels($firstModel, $secondModel) { if (!($firstModel instanceof Model && $secondModel instanceof Model)) { @@ -785,6 +805,7 @@ public function createVariant(ConfigInterface $objConfig, array $doNotCopy = []) * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ + #[\Override] public function getLanguages($mixID) { $metaModel = $this->getMetaModel(); @@ -819,6 +840,7 @@ public function getLanguages($mixID) * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ + #[\Override] public function getFallbackLanguage($mixID) { $metaModel = $this->getMetaModel(); @@ -847,6 +869,7 @@ public function getFallbackLanguage($mixID) * * @return DataProviderInterface */ + #[\Override] public function setCurrentLanguage($language) { $this->strCurrentLanguage = $language; @@ -859,6 +882,7 @@ public function setCurrentLanguage($language) * * @return string Short tag for the current working language like de or for etc. */ + #[\Override] public function getCurrentLanguage() { return '' === $this->strCurrentLanguage ? 'en' : $this->strCurrentLanguage; diff --git a/src/DcGeneral/Data/Model.php b/src/DcGeneral/Data/Model.php index d763b323a..fd992616e 100644 --- a/src/DcGeneral/Data/Model.php +++ b/src/DcGeneral/Data/Model.php @@ -101,6 +101,7 @@ public function __construct($objItem, ?string $language = null) /** * {@inheritDoc} */ + #[\Override] public function __clone() { $item = $this->getItem(); @@ -111,6 +112,7 @@ public function __clone() /** * {@inheritDoc} */ + #[\Override] public function getId() { $item = $this->getItem(); @@ -123,6 +125,7 @@ public function getId() /** * {@inheritDoc} */ + #[\Override] public function getProperty($propertyName) { if (null !== ($item = $this->getItem())) { @@ -142,6 +145,7 @@ public function getProperty($propertyName) /** * {@inheritDoc} */ + #[\Override] public function getPropertiesAsArray() { $arrResult = []; @@ -156,6 +160,7 @@ public function getPropertiesAsArray() /** * {@inheritDoc} */ + #[\Override] public function getMeta($strMetaName) { if (\array_key_exists($strMetaName, $this->arrMetaInformation)) { @@ -168,6 +173,7 @@ public function getMeta($strMetaName) /** * {@inheritDoc} */ + #[\Override] public function setId($mixId) { if ($this->getId() === null) { @@ -186,6 +192,7 @@ public function setId($mixId) * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.Superglobals) */ + #[\Override] public function setProperty($strPropertyName, $varValue) { if (null !== ($item = $this->getItem())) { @@ -243,6 +250,7 @@ public function setProperty($strPropertyName, $varValue) /** * {@inheritDoc} */ + #[\Override] public function setPropertiesAsArray($properties) { foreach ($properties as $strKey => $varValue) { @@ -253,6 +261,7 @@ public function setPropertiesAsArray($properties) /** * {@inheritDoc} */ + #[\Override] public function setMeta($strMetaName, $varValue) { $this->arrMetaInformation[$strMetaName] = $varValue; @@ -261,6 +270,7 @@ public function setMeta($strMetaName, $varValue) /** * {@inheritDoc} */ + #[\Override] public function hasProperties() { return (bool) $this->getItem(); @@ -271,6 +281,7 @@ public function hasProperties() * * @return \Traversable */ + #[\Override] #[\ReturnTypeWillChange] public function getIterator() { @@ -280,6 +291,7 @@ public function getIterator() /** * {@inheritDoc} */ + #[\Override] public function getProviderName() { $item = $this->getItem(); @@ -293,6 +305,7 @@ public function getProviderName() * * @throws DcGeneralInvalidArgumentException When a property in the value bag has been marked as invalid. */ + #[\Override] public function readFromPropertyValueBag(PropertyValueBagInterface $valueBag) { foreach ($this->getPropertyNames() as $property) { @@ -313,6 +326,7 @@ public function readFromPropertyValueBag(PropertyValueBagInterface $valueBag) /** * {@inheritDoc} */ + #[\Override] public function writeToPropertyValueBag(PropertyValueBagInterface $valueBag) { foreach ($this->getPropertyNames() as $property) { diff --git a/src/DcGeneral/Data/ModelIterator.php b/src/DcGeneral/Data/ModelIterator.php index dcb10bf1e..6a855c772 100644 --- a/src/DcGeneral/Data/ModelIterator.php +++ b/src/DcGeneral/Data/ModelIterator.php @@ -88,6 +88,7 @@ public function __construct(Model $objModel) * * @return void */ + #[\Override] public function rewind(): void { $this->intPosition = 0; @@ -98,6 +99,7 @@ public function rewind(): void * * @return mixed */ + #[\Override] public function current(): mixed { $model = $this->objModel; @@ -111,6 +113,7 @@ public function current(): mixed * * @return string */ + #[\Override] public function key(): string { $arrKeys = $this->getKeys(); @@ -123,6 +126,7 @@ public function key(): string * * @return void */ + #[\Override] public function next(): void { ++$this->intPosition; @@ -133,6 +137,7 @@ public function next(): void * * @return bool */ + #[\Override] public function valid(): bool { return \strlen($this->key()) > 0; diff --git a/src/DcGeneral/DataDefinition/Definition/MetaModelDefinition.php b/src/DcGeneral/DataDefinition/Definition/MetaModelDefinition.php index 78f3f29ee..a5338cefb 100644 --- a/src/DcGeneral/DataDefinition/Definition/MetaModelDefinition.php +++ b/src/DcGeneral/DataDefinition/Definition/MetaModelDefinition.php @@ -45,6 +45,7 @@ class MetaModelDefinition implements IMetaModelDefinition /** * {@inheritdoc} */ + #[\Override] public function setActiveRenderSetting($renderSettingId) { $this->activeRenderSetting = $renderSettingId; @@ -55,6 +56,7 @@ public function setActiveRenderSetting($renderSettingId) /** * {@inheritdoc} */ + #[\Override] public function hasActiveRenderSetting() { return isset($this->activeRenderSetting); @@ -63,6 +65,7 @@ public function hasActiveRenderSetting() /** * {@inheritdoc} */ + #[\Override] public function getActiveRenderSetting() { return $this->activeRenderSetting; @@ -71,6 +74,7 @@ public function getActiveRenderSetting() /** * {@inheritdoc} */ + #[\Override] public function setActiveInputScreen($renderSettingId) { $this->activeInputScreen = $renderSettingId; @@ -81,6 +85,7 @@ public function setActiveInputScreen($renderSettingId) /** * {@inheritdoc} */ + #[\Override] public function hasActiveInputScreen() { return isset($this->activeInputScreen); @@ -89,6 +94,7 @@ public function hasActiveInputScreen() /** * {@inheritdoc} */ + #[\Override] public function getActiveInputScreen() { return $this->activeInputScreen; diff --git a/src/DcGeneral/DataDefinition/MetaModelDataDefinition.php b/src/DcGeneral/DataDefinition/MetaModelDataDefinition.php index dd23bdb13..583922a10 100644 --- a/src/DcGeneral/DataDefinition/MetaModelDataDefinition.php +++ b/src/DcGeneral/DataDefinition/MetaModelDataDefinition.php @@ -32,6 +32,7 @@ class MetaModelDataDefinition extends DefaultContainer implements IMetaModelData /** * {@inheritDoc} */ + #[\Override] public function setMetaModelDefinition(IMetaModelDefinition $definition) { $this->setDefinition(IMetaModelDefinition::NAME, $definition); @@ -42,6 +43,7 @@ public function setMetaModelDefinition(IMetaModelDefinition $definition) /** * {@inheritDoc} */ + #[\Override] public function hasMetaModelDefinition() { return $this->hasDefinition(IMetaModelDefinition::NAME); @@ -50,6 +52,7 @@ public function hasMetaModelDefinition() /** * {@inheritDoc} */ + #[\Override] public function getMetaModelDefinition() { $definition = $this->getDefinition(IMetaModelDefinition::NAME); diff --git a/src/DcGeneral/DataDefinition/Palette/Condition/Palette/RenderSettingAttributeIs.php b/src/DcGeneral/DataDefinition/Palette/Condition/Palette/RenderSettingAttributeIs.php index 9d36ed815..9efbef133 100644 --- a/src/DcGeneral/DataDefinition/Palette/Condition/Palette/RenderSettingAttributeIs.php +++ b/src/DcGeneral/DataDefinition/Palette/Condition/Palette/RenderSettingAttributeIs.php @@ -144,6 +144,7 @@ public function getTypeOfAttribute($value) /** * {@inheritdoc} */ + #[\Override] public function getMatchCount(ModelInterface $model = null, PropertyValueBag $input = null) { $value = null; @@ -165,6 +166,7 @@ public function getMatchCount(ModelInterface $model = null, PropertyValueBag $in /** * {@inheritdoc} */ + #[\Override] public function __clone() { } diff --git a/src/DcGeneral/DataDefinition/Palette/Condition/Property/AttributeByIdIsOfType.php b/src/DcGeneral/DataDefinition/Palette/Condition/Property/AttributeByIdIsOfType.php index 5c2828bce..8afc99c5f 100644 --- a/src/DcGeneral/DataDefinition/Palette/Condition/Property/AttributeByIdIsOfType.php +++ b/src/DcGeneral/DataDefinition/Palette/Condition/Property/AttributeByIdIsOfType.php @@ -133,6 +133,7 @@ public function getTypeOfAttribute($value) /** * {@inheritdoc} */ + #[\Override] public function match( ModelInterface $model = null, PropertyValueBag $input = null, @@ -153,6 +154,7 @@ public function match( /** * {@inheritdoc} */ + #[\Override] public function __clone() { } diff --git a/src/DcGeneral/DataDefinition/Palette/Condition/Property/ConditionTableNameIsMetaModel.php b/src/DcGeneral/DataDefinition/Palette/Condition/Property/ConditionTableNameIsMetaModel.php index c98c8ef48..042babbad 100644 --- a/src/DcGeneral/DataDefinition/Palette/Condition/Property/ConditionTableNameIsMetaModel.php +++ b/src/DcGeneral/DataDefinition/Palette/Condition/Property/ConditionTableNameIsMetaModel.php @@ -109,6 +109,7 @@ public function getTablePropertyName() /** * {@inheritdoc} */ + #[\Override] public function match( ModelInterface $model = null, PropertyValueBag $input = null, @@ -130,6 +131,7 @@ public function match( /** * {@inheritdoc} */ + #[\Override] public function __clone() { } diff --git a/src/DcGeneral/DataDefinition/Palette/Condition/Property/FilterSettingTypeSubPaletteCondition.php b/src/DcGeneral/DataDefinition/Palette/Condition/Property/FilterSettingTypeSubPaletteCondition.php index 73fad186b..522d1403e 100644 --- a/src/DcGeneral/DataDefinition/Palette/Condition/Property/FilterSettingTypeSubPaletteCondition.php +++ b/src/DcGeneral/DataDefinition/Palette/Condition/Property/FilterSettingTypeSubPaletteCondition.php @@ -61,6 +61,7 @@ public function __construct(IFilterSettingFactory $filterFactory, $filterType) /** * {@inheritdoc} */ + #[\Override] public function match( ModelInterface $model = null, PropertyValueBag $input = null, @@ -84,6 +85,7 @@ public function match( /** * {@inheritdoc} */ + #[\Override] public function __clone() { } diff --git a/src/DcGeneral/DataDefinition/Palette/Condition/Property/InputScreenRenderModeIs.php b/src/DcGeneral/DataDefinition/Palette/Condition/Property/InputScreenRenderModeIs.php index ca107c733..9abec4d82 100644 --- a/src/DcGeneral/DataDefinition/Palette/Condition/Property/InputScreenRenderModeIs.php +++ b/src/DcGeneral/DataDefinition/Palette/Condition/Property/InputScreenRenderModeIs.php @@ -144,6 +144,7 @@ public function getInputScreenRenderMode($value) /** * {@inheritdoc} */ + #[\Override] public function match( ModelInterface $model = null, PropertyValueBag $input = null, @@ -164,6 +165,7 @@ public function match( /** * {@inheritdoc} */ + #[\Override] public function __clone() { } diff --git a/src/DcGeneral/DataDefinition/Palette/Condition/Property/IsVariantAttribute.php b/src/DcGeneral/DataDefinition/Palette/Condition/Property/IsVariantAttribute.php index dabcfa60f..ef4b74018 100644 --- a/src/DcGeneral/DataDefinition/Palette/Condition/Property/IsVariantAttribute.php +++ b/src/DcGeneral/DataDefinition/Palette/Condition/Property/IsVariantAttribute.php @@ -41,6 +41,7 @@ class IsVariantAttribute implements PropertyConditionInterface /** * {@inheritdoc} */ + #[\Override] public function match( ModelInterface $model = null, PropertyValueBag $input = null, @@ -64,6 +65,7 @@ public function match( /** * {@inheritdoc} */ + #[\Override] public function __clone() { } diff --git a/src/DcGeneral/DataDefinition/Palette/Condition/Property/PropertyContainAnyOfCondition.php b/src/DcGeneral/DataDefinition/Palette/Condition/Property/PropertyContainAnyOfCondition.php index 10c21b6b9..86e061ece 100644 --- a/src/DcGeneral/DataDefinition/Palette/Condition/Property/PropertyContainAnyOfCondition.php +++ b/src/DcGeneral/DataDefinition/Palette/Condition/Property/PropertyContainAnyOfCondition.php @@ -178,6 +178,7 @@ public function getStrict() * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) */ + #[\Override] public function match( ModelInterface $model = null, PropertyValueBag $input = null, @@ -231,6 +232,7 @@ public function match( /** * {@inheritdoc} */ + #[\Override] public function __clone() { } diff --git a/src/DcGeneral/DataDefinition/Palette/Condition/Property/PropertyValueCondition.php b/src/DcGeneral/DataDefinition/Palette/Condition/Property/PropertyValueCondition.php index 06538caa8..433fbef5d 100644 --- a/src/DcGeneral/DataDefinition/Palette/Condition/Property/PropertyValueCondition.php +++ b/src/DcGeneral/DataDefinition/Palette/Condition/Property/PropertyValueCondition.php @@ -129,6 +129,7 @@ public function getStrict(): bool /** * {@inheritdoc} */ + #[\Override] public function match( ModelInterface $model = null, PropertyValueBag $input = null, @@ -162,6 +163,7 @@ public function match( /** * {@inheritdoc} */ + #[\Override] public function __clone() { } diff --git a/src/Factory.php b/src/Factory.php index 70e02d654..a9f82e359 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -81,6 +81,7 @@ public function __construct(EventDispatcherInterface $dispatcher) * * @psalm-suppress DeprecatedInterface */ + #[\Override] public function setServiceContainer(IMetaModelsServiceContainer $serviceContainer, $deprecationNotice = true) { if ($deprecationNotice) { @@ -106,6 +107,7 @@ public function setServiceContainer(IMetaModelsServiceContainer $serviceContaine * * @psalm-suppress DeprecatedInterface */ + #[\Override] public function getServiceContainer() { if (null === $this->serviceContainer) { @@ -124,6 +126,7 @@ public function getServiceContainer() /** * {@inheritdoc} */ + #[\Override] public function translateIdToMetaModelName($metaModelId) { if (!isset($this->lookupMap[$metaModelId])) { @@ -144,6 +147,7 @@ public function translateIdToMetaModelName($metaModelId) /** * {@inheritdoc} */ + #[\Override] public function getMetaModel($metaModelName) { $event = new CreateMetaModelEvent($this, $metaModelName); @@ -156,6 +160,7 @@ public function getMetaModel($metaModelName) /** * {@inheritdoc} */ + #[\Override] public function collectNames() { $event = new CollectMetaModelTableNamesEvent($this); diff --git a/src/Filter/Filter.php b/src/Filter/Filter.php index f1fa25d94..3273fa610 100644 --- a/src/Filter/Filter.php +++ b/src/Filter/Filter.php @@ -80,6 +80,7 @@ public function __clone() * * @return Filter|IFilter */ + #[\Override] public function createCopy() { return clone $this; @@ -88,6 +89,7 @@ public function createCopy() /** * {@inheritdoc} */ + #[\Override] public function addFilterRule(IFilterRule $objFilterRule) { // Reset matches as they are most likely invalid now. @@ -101,6 +103,7 @@ public function addFilterRule(IFilterRule $objFilterRule) /** * {@inheritdoc} */ + #[\Override] public function getMatchingIds() { if ($this->arrMatches !== null) { diff --git a/src/Filter/Rules/Comparing/GreaterThan.php b/src/Filter/Rules/Comparing/GreaterThan.php index 82d4203f1..3b534f25e 100644 --- a/src/Filter/Rules/Comparing/GreaterThan.php +++ b/src/Filter/Rules/Comparing/GreaterThan.php @@ -72,6 +72,7 @@ public function __construct(IAttribute $objAttribute, $varValue, $blnInclusive = * * @return list|null */ + #[\Override] public function getMatchingIds() { return $this->objAttribute->filterGreaterThan($this->varValue, $this->blnInclusive); diff --git a/src/Filter/Rules/Comparing/LessThan.php b/src/Filter/Rules/Comparing/LessThan.php index 536c29fac..99b8fafd5 100644 --- a/src/Filter/Rules/Comparing/LessThan.php +++ b/src/Filter/Rules/Comparing/LessThan.php @@ -72,6 +72,7 @@ public function __construct(IAttribute $objAttribute, $varValue, $blnInclusive = * * @return list|null */ + #[\Override] public function getMatchingIds() { return $this->objAttribute->filterLessThan($this->varValue, $this->blnInclusive); diff --git a/src/Filter/Rules/Comparing/NotEqual.php b/src/Filter/Rules/Comparing/NotEqual.php index 82b655a5c..7abd91033 100644 --- a/src/Filter/Rules/Comparing/NotEqual.php +++ b/src/Filter/Rules/Comparing/NotEqual.php @@ -62,6 +62,7 @@ public function __construct(IAttribute $objAttribute, $varValue) * * @return list|null */ + #[\Override] public function getMatchingIds() { return $this->objAttribute->filterNotEqual($this->varValue); diff --git a/src/Filter/Rules/Condition/ConditionAnd.php b/src/Filter/Rules/Condition/ConditionAnd.php index a65841986..a922d9f94 100644 --- a/src/Filter/Rules/Condition/ConditionAnd.php +++ b/src/Filter/Rules/Condition/ConditionAnd.php @@ -53,6 +53,7 @@ public function addChild(IFilter $objFilter) /** * {@inheritdoc} */ + #[\Override] public function getMatchingIds() { if (0 === count($this->arrChildFilters)) { diff --git a/src/Filter/Rules/Condition/ConditionOr.php b/src/Filter/Rules/Condition/ConditionOr.php index e777da848..37aa4854d 100644 --- a/src/Filter/Rules/Condition/ConditionOr.php +++ b/src/Filter/Rules/Condition/ConditionOr.php @@ -92,6 +92,7 @@ public function addChild(IFilter $objFilter) * * @return list|null */ + #[\Override] public function getMatchingIds() { $arrIds = []; diff --git a/src/Filter/Rules/SearchAttribute.php b/src/Filter/Rules/SearchAttribute.php index 18134e113..cf8ac1d0b 100644 --- a/src/Filter/Rules/SearchAttribute.php +++ b/src/Filter/Rules/SearchAttribute.php @@ -70,6 +70,7 @@ public function __construct($objAttribute, $strValue = '', $arrValidLanguages = /** * {@inheritdoc} */ + #[\Override] public function getMatchingIds() { if ($this->objAttribute instanceof ITranslated) { diff --git a/src/Filter/Rules/SimpleQuery.php b/src/Filter/Rules/SimpleQuery.php index 589a24acf..8847f2b52 100644 --- a/src/Filter/Rules/SimpleQuery.php +++ b/src/Filter/Rules/SimpleQuery.php @@ -118,6 +118,7 @@ public function __construct($queryString, $params = [], $idColumn = 'id', $conne /** * {@inheritdoc} */ + #[\Override] public function getMatchingIds() { $matches = $this->connection->executeQuery($this->queryString, $this->params, $this->types); diff --git a/src/Filter/Rules/StaticIdList.php b/src/Filter/Rules/StaticIdList.php index 4a5b2ca23..390561b27 100644 --- a/src/Filter/Rules/StaticIdList.php +++ b/src/Filter/Rules/StaticIdList.php @@ -50,6 +50,7 @@ public function __construct($arrIds) /** * {@inheritdoc} */ + #[\Override] public function getMatchingIds() { return $this->arrIds; diff --git a/src/Filter/Setting/AbstractFilterSettingTypeFactory.php b/src/Filter/Setting/AbstractFilterSettingTypeFactory.php index 05e42b9e3..ad63b482e 100644 --- a/src/Filter/Setting/AbstractFilterSettingTypeFactory.php +++ b/src/Filter/Setting/AbstractFilterSettingTypeFactory.php @@ -127,6 +127,7 @@ protected function setTypeName($typeName) /** * {@inheritdoc} */ + #[\Override] public function getTypeName() { return $this->typeName; @@ -149,6 +150,7 @@ protected function setTypeIcon($typeIcon) /** * {@inheritdoc} */ + #[\Override] public function getTypeIcon() { return $this->typeIcon; @@ -157,6 +159,7 @@ public function getTypeIcon() /** * {@inheritdoc} */ + #[\Override] public function createInstance($information, $filterSettings) { return new $this->typeClass($filterSettings, $information); @@ -167,6 +170,7 @@ public function createInstance($information, $filterSettings) * * @return bool */ + #[\Override] public function isNestedType() { if (null === $this->isNestedType) { @@ -200,6 +204,7 @@ protected function setMaxChildren($maxChildren) /** * {@inheritdoc} */ + #[\Override] public function getMaxChildren() { return $this->isNestedType() ? $this->maxChildren : 0; @@ -238,6 +243,7 @@ protected function allowAttributeTypes($initialType1toN = null) * * @return list|null The list of attribute names or null if no attributes are allowed. */ + #[\Override] public function getKnownAttributeTypes() { return $this->attributeTypes; @@ -252,6 +258,7 @@ public function getKnownAttributeTypes() * * @throws \LogicException When the filter setting can not handle attributes. */ + #[\Override] public function addKnownAttributeType($typeName) { if (!\is_array($this->attributeTypes)) { diff --git a/src/Filter/Setting/Collection.php b/src/Filter/Setting/Collection.php index 48cd63249..19272aa9f 100644 --- a/src/Filter/Setting/Collection.php +++ b/src/Filter/Setting/Collection.php @@ -72,6 +72,7 @@ public function __construct($arrData) /** * {@inheritdoc} */ + #[\Override] public function get($key) { return ($this->arrData[$key] ?? null); @@ -98,6 +99,7 @@ public function setMetaModel($metaModel): self * * @throws \RuntimeException When the MetaModel can not be determined. */ + #[\Override] public function getMetaModel() { if (null === $this->metaModel) { @@ -124,6 +126,7 @@ public function addSetting($setting): self /** * {@inheritdoc} */ + #[\Override] public function addRules(IFilter $objFilter, $arrFilterUrl, $arrIgnoredFilter = array()) { foreach ($this->arrSettings as $objSetting) { @@ -139,6 +142,7 @@ public function addRules(IFilter $objFilter, $arrFilterUrl, $arrIgnoredFilter = /** * {@inheritdoc} */ + #[\Override] public function generateFilterUrlFrom(IItem $objItem, IRenderSettings $objRenderSetting) { $filterUrl = []; @@ -152,6 +156,7 @@ public function generateFilterUrlFrom(IItem $objItem, IRenderSettings $objRender /** * {@inheritdoc} */ + #[\Override] public function getParameters() { $parameters = []; @@ -165,6 +170,7 @@ public function getParameters() /** * {@inheritdoc} */ + #[\Override] public function getParameterDCA() { $parameters = []; @@ -178,6 +184,7 @@ public function getParameterDCA() /** * {@inheritdoc} */ + #[\Override] public function getParameterFilterNames() { $parameters = []; @@ -195,6 +202,7 @@ public function getParameterFilterNames() * * @SuppressWarnings(PHPMD.LongVariable) */ + #[\Override] public function getParameterFilterWidgets( $arrFilterUrl, $arrJumpTo, @@ -236,6 +244,7 @@ public function getParameterFilterWidgets( /** * {@inheritdoc} */ + #[\Override] public function getReferencedAttributes() { $attributes = []; diff --git a/src/Filter/Setting/Condition/ConditionAnd.php b/src/Filter/Setting/Condition/ConditionAnd.php index ee69c26e4..e25c42ecc 100644 --- a/src/Filter/Setting/Condition/ConditionAnd.php +++ b/src/Filter/Setting/Condition/ConditionAnd.php @@ -35,6 +35,7 @@ class ConditionAnd extends WithChildren /** * {@inheritdoc} */ + #[\Override] public function prepareRules(IFilter $objFilter, $arrFilterUrl) { $objSubFilter = new Filter($this->getMetaModel()); diff --git a/src/Filter/Setting/Condition/ConditionOr.php b/src/Filter/Setting/Condition/ConditionOr.php index 4fafceb8a..a990c934d 100644 --- a/src/Filter/Setting/Condition/ConditionOr.php +++ b/src/Filter/Setting/Condition/ConditionOr.php @@ -35,6 +35,7 @@ class ConditionOr extends WithChildren /** * {@inheritdoc} */ + #[\Override] public function prepareRules(IFilter $objFilter, $arrFilterUrl) { $objFilterRule = new FilterRuleOr($this->get('stop_after_match')); diff --git a/src/Filter/Setting/ConditionAndFilterSettingTypeFactory.php b/src/Filter/Setting/ConditionAndFilterSettingTypeFactory.php index e02908b87..cb0c1379a 100644 --- a/src/Filter/Setting/ConditionAndFilterSettingTypeFactory.php +++ b/src/Filter/Setting/ConditionAndFilterSettingTypeFactory.php @@ -51,6 +51,7 @@ public function __construct( /** * {@inheritdoc} */ + #[\Override] public function createInstance($information, $filterSettings) { return new ConditionAnd( diff --git a/src/Filter/Setting/ConditionOrFilterSettingTypeFactory.php b/src/Filter/Setting/ConditionOrFilterSettingTypeFactory.php index 365664da4..5baddba61 100644 --- a/src/Filter/Setting/ConditionOrFilterSettingTypeFactory.php +++ b/src/Filter/Setting/ConditionOrFilterSettingTypeFactory.php @@ -51,6 +51,7 @@ public function __construct( /** * {@inheritdoc} */ + #[\Override] public function createInstance($information, $filterSettings) { return new ConditionOr( diff --git a/src/Filter/Setting/CustomSql.php b/src/Filter/Setting/CustomSql.php index 74590aad7..49af48caf 100644 --- a/src/Filter/Setting/CustomSql.php +++ b/src/Filter/Setting/CustomSql.php @@ -157,6 +157,7 @@ public function __construct($collection, $data, ContainerInterface $container) * * @return array */ + #[\Override] public static function getSubscribedServices(): array { return [ @@ -173,6 +174,7 @@ public static function getSubscribedServices(): array /** * {@inheritdoc} */ + #[\Override] public function get($strKey) { return $this->data[$strKey] ?? null; @@ -181,6 +183,7 @@ public function get($strKey) /** * {@inheritdoc} */ + #[\Override] public function prepareRules(IFilter $objFilter, $arrFilterUrl) { if ($this->isAllowedScope()) { @@ -205,6 +208,7 @@ public function prepareRules(IFilter $objFilter, $arrFilterUrl) /** * {@inheritdoc} */ + #[\Override] public function generateFilterUrlFrom(IItem $objItem, IRenderSettings $objRenderSetting) { return []; @@ -213,6 +217,7 @@ public function generateFilterUrlFrom(IItem $objItem, IRenderSettings $objRender /** * {@inheritDoc} */ + #[\Override] public function getParameters() { $arrParams = []; @@ -232,6 +237,7 @@ public function getParameters() /** * {@inheritdoc} */ + #[\Override] public function getParameterDCA() { return []; @@ -240,6 +246,7 @@ public function getParameterDCA() /** * {@inheritdoc} */ + #[\Override] public function getParameterFilterNames() { return []; @@ -250,6 +257,7 @@ public function getParameterFilterNames() * * @SuppressWarnings(PHPMD.LongVariable) */ + #[\Override] public function getParameterFilterWidgets( $arrIds, $arrFilterUrl, @@ -262,6 +270,7 @@ public function getParameterFilterWidgets( /** * {@inheritdoc} */ + #[\Override] public function getReferencedAttributes() { return []; diff --git a/src/Filter/Setting/CustomSqlFilterSettingTypeFactory.php b/src/Filter/Setting/CustomSqlFilterSettingTypeFactory.php index bbfb3789d..6e4330af0 100644 --- a/src/Filter/Setting/CustomSqlFilterSettingTypeFactory.php +++ b/src/Filter/Setting/CustomSqlFilterSettingTypeFactory.php @@ -54,6 +54,7 @@ public function __construct(ContainerInterface $container) /** * {@inheritdoc} */ + #[\Override] public function createInstance($information, $filterSettings) { return new CustomSql( diff --git a/src/Filter/Setting/FilterSettingFactory.php b/src/Filter/Setting/FilterSettingFactory.php index 2e0d46075..97d372281 100644 --- a/src/Filter/Setting/FilterSettingFactory.php +++ b/src/Filter/Setting/FilterSettingFactory.php @@ -95,6 +95,7 @@ public function __construct( * * @deprecated The service container will get removed, use the symfony service container instead. */ + #[\Override] public function setServiceContainer(IMetaModelsServiceContainer $serviceContainer, bool $deprecationNotice = true) { if ($deprecationNotice) { @@ -130,6 +131,7 @@ public function setServiceContainer(IMetaModelsServiceContainer $serviceContaine * * @deprecated The service container will get removed, use the symfony service container instead. */ + #[\Override] public function getServiceContainer() { // @codingStandardsIgnoreStart @@ -146,6 +148,7 @@ public function getServiceContainer() * * @throws \RuntimeException When the type is already registered. */ + #[\Override] public function addTypeFactory($factory) { $typeName = $factory->getTypeName(); @@ -160,6 +163,7 @@ public function addTypeFactory($factory) /** * {@inheritdoc} */ + #[\Override] public function getTypeFactory($type) { return isset($this->typeFactories[$type]) ? $this->typeFactories[$type] : null; @@ -257,6 +261,7 @@ public function collectRules($filterSettings) * * @throws \RuntimeException When the MetaModel could not be retrieved. */ + #[\Override] public function createCollection($settingId) { $query = $this->database @@ -287,6 +292,7 @@ public function createCollection($settingId) /** * {@inheritdoc} */ + #[\Override] public function getTypeNames() { return \array_keys($this->typeFactories); diff --git a/src/Filter/Setting/IdList.php b/src/Filter/Setting/IdList.php index dc0698c59..a8216c55c 100644 --- a/src/Filter/Setting/IdList.php +++ b/src/Filter/Setting/IdList.php @@ -33,6 +33,7 @@ class IdList extends Simple * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ + #[\Override] public function prepareRules(IFilter $objFilter, $arrFilterUrl) { if ($this->get('items')) { diff --git a/src/Filter/Setting/Simple.php b/src/Filter/Setting/Simple.php index cad98dfba..f4f76ee99 100644 --- a/src/Filter/Setting/Simple.php +++ b/src/Filter/Setting/Simple.php @@ -187,6 +187,7 @@ public function getEventDispatcher() /** * {@inheritdoc} */ + #[\Override] public function get($strKey) { return $this->data[$strKey] ?? null; @@ -549,6 +550,7 @@ protected function prepareFrontendFilterWidget( /** * {@inheritdoc} */ + #[\Override] public function generateFilterUrlFrom(IItem $objItem, IRenderSettings $objRenderSetting) { return []; @@ -557,6 +559,7 @@ public function generateFilterUrlFrom(IItem $objItem, IRenderSettings $objRender /** * {@inheritdoc} */ + #[\Override] public function getParameters() { return []; @@ -565,6 +568,7 @@ public function getParameters() /** * {@inheritdoc} */ + #[\Override] public function getParameterDCA() { return []; @@ -573,6 +577,7 @@ public function getParameterDCA() /** * {@inheritdoc} */ + #[\Override] public function getParameterFilterNames() { return []; @@ -583,6 +588,7 @@ public function getParameterFilterNames() * * @SuppressWarnings(PHPMD.LongVariable) */ + #[\Override] public function getParameterFilterWidgets( $arrIds, $arrFilterUrl, @@ -595,6 +601,7 @@ public function getParameterFilterWidgets( /** * {@inheritdoc} */ + #[\Override] public function getReferencedAttributes() { return []; diff --git a/src/Filter/Setting/SimpleLookup.php b/src/Filter/Setting/SimpleLookup.php index 04aa96b15..9537a3ec5 100644 --- a/src/Filter/Setting/SimpleLookup.php +++ b/src/Filter/Setting/SimpleLookup.php @@ -151,6 +151,7 @@ public function enableFEFilterWidget() /** * {@inheritdoc} */ + #[\Override] public function prepareRules(IFilter $objFilter, $arrFilterUrl) { $objMetaModel = $this->getMetaModel(); @@ -181,6 +182,7 @@ public function prepareRules(IFilter $objFilter, $arrFilterUrl) /** * {@inheritdoc} */ + #[\Override] public function generateFilterUrlFrom(IItem $objItem, IRenderSettings $objRenderSetting) { if ($attribute = $this->getFilteredAttribute()) { @@ -195,6 +197,7 @@ public function generateFilterUrlFrom(IItem $objItem, IRenderSettings $objRender /** * {@inheritdoc} */ + #[\Override] public function getParameters() { return (null !== ($strParamName = $this->getParamName())) ? [$strParamName] : []; @@ -206,6 +209,7 @@ public function getParameters() * @SuppressWarnings(PHPMD.Superglobals) * @SuppressWarnings(PHPMD.CamelCaseVariableName) */ + #[\Override] public function getParameterDCA() { // If defined as static, return nothing as not to be manipulated via editors. @@ -238,6 +242,7 @@ public function getParameterDCA() /** * {@inheritdoc} */ + #[\Override] public function getParameterFilterNames() { if (null !== ($label = $this->getLabel()) && null !== ($paramName = $this->getParamName())) { @@ -256,6 +261,7 @@ public function getParameterFilterNames() * @SuppressWarnings(PHPMD.CamelCaseVariableName) * @SuppressWarnings(PHPMD.LongVariable) */ + #[\Override] public function getParameterFilterWidgets( $arrIds, $arrFilterUrl, @@ -321,6 +327,7 @@ public function getParameterFilterWidgets( /** * {@inheritdoc} */ + #[\Override] public function getReferencedAttributes() { if ($attribute = $this->getFilteredAttribute()) { diff --git a/src/Filter/Setting/SimpleLookupFilterSettingTypeFactory.php b/src/Filter/Setting/SimpleLookupFilterSettingTypeFactory.php index dbaeb9800..4ccc9944b 100644 --- a/src/Filter/Setting/SimpleLookupFilterSettingTypeFactory.php +++ b/src/Filter/Setting/SimpleLookupFilterSettingTypeFactory.php @@ -50,6 +50,7 @@ public function __construct( /** * {@inheritdoc} */ + #[\Override] public function createInstance($information, $filterSettings) { return new SimpleLookup( diff --git a/src/Filter/Setting/StaticIdListFilterSettingTypeFactory.php b/src/Filter/Setting/StaticIdListFilterSettingTypeFactory.php index d673964d8..5b6eb2d6e 100644 --- a/src/Filter/Setting/StaticIdListFilterSettingTypeFactory.php +++ b/src/Filter/Setting/StaticIdListFilterSettingTypeFactory.php @@ -49,6 +49,7 @@ public function __construct( /** * {@inheritdoc} */ + #[\Override] public function createInstance($information, $filterSettings) { return new IdList( diff --git a/src/Filter/Setting/WithChildren.php b/src/Filter/Setting/WithChildren.php index afb7521a4..f419d438e 100644 --- a/src/Filter/Setting/WithChildren.php +++ b/src/Filter/Setting/WithChildren.php @@ -44,6 +44,7 @@ abstract class WithChildren extends Simple implements IWithChildren /** * {@inheritdoc} */ + #[\Override] public function addChild(ISimple $objFilterSetting) { $this->arrChildren[] = $objFilterSetting; @@ -52,6 +53,7 @@ public function addChild(ISimple $objFilterSetting) /** * {@inheritdoc} */ + #[\Override] public function generateFilterUrlFrom(IItem $objItem, IRenderSettings $objRenderSetting) { $arrFilterUrl = array(); @@ -64,6 +66,7 @@ public function generateFilterUrlFrom(IItem $objItem, IRenderSettings $objRender /** * {@inheritdoc} */ + #[\Override] public function getParameters() { $arrParams = array(); @@ -76,6 +79,7 @@ public function getParameters() /** * {@inheritdoc} */ + #[\Override] public function getParameterDCA() { $arrParams = array(); @@ -90,6 +94,7 @@ public function getParameterDCA() * * @SuppressWarnings(PHPMD.LongVariable) */ + #[\Override] public function getParameterFilterWidgets( $arrIds, $arrFilterUrl, @@ -109,6 +114,7 @@ public function getParameterFilterWidgets( /** * {@inheritdoc} */ + #[\Override] public function getParameterFilterNames() { $arrParams = []; @@ -123,6 +129,7 @@ public function getParameterFilterNames() * * @return list */ + #[\Override] public function getReferencedAttributes() { $arrAttributes = []; diff --git a/src/FrontendIntegration/HybridFilterBlock.php b/src/FrontendIntegration/HybridFilterBlock.php index 6d6e9e732..6cf118973 100644 --- a/src/FrontendIntegration/HybridFilterBlock.php +++ b/src/FrontendIntegration/HybridFilterBlock.php @@ -145,6 +145,7 @@ public function getFilterCollection() * * @return string */ + #[\Override] public function generate() { // Get template if configured. @@ -161,6 +162,7 @@ public function generate() * * @return void */ + #[\Override] protected function compile() { $objFilter = new FrontendFilter($this->getConnection(), $this->getFilterUrlBuilder()); diff --git a/src/FrontendIntegration/HybridFilterClearAll.php b/src/FrontendIntegration/HybridFilterClearAll.php index 9ca69909e..0b152299e 100644 --- a/src/FrontendIntegration/HybridFilterClearAll.php +++ b/src/FrontendIntegration/HybridFilterClearAll.php @@ -65,6 +65,7 @@ abstract class HybridFilterClearAll extends MetaModelHybrid * * @return string */ + #[\Override] public function generate() { $scopeMatcher = System::getContainer()->get('contao.routing.scope_matcher'); @@ -89,6 +90,7 @@ public function generate() * @SuppressWarnings(PHPMD.Superglobals) * @SuppressWarnings(PHPMD.CamelCaseVariableName) */ + #[\Override] protected function compile() { $blnActiveParam = false; diff --git a/src/FrontendIntegration/HybridList.php b/src/FrontendIntegration/HybridList.php index 0d7612e37..a10fd9c05 100644 --- a/src/FrontendIntegration/HybridList.php +++ b/src/FrontendIntegration/HybridList.php @@ -57,6 +57,7 @@ class HybridList extends MetaModelHybrid * * @return string */ + #[\Override] public function generate() { // Fallback template. @@ -106,6 +107,7 @@ protected function getFilterParameters($objItemRenderer) * * @return void */ + #[\Override] protected function compile() { $objItemRenderer = new ItemList(); diff --git a/src/FrontendIntegration/MetaModelHybrid.php b/src/FrontendIntegration/MetaModelHybrid.php index 93f47ab7e..b0b4a3ae1 100644 --- a/src/FrontendIntegration/MetaModelHybrid.php +++ b/src/FrontendIntegration/MetaModelHybrid.php @@ -184,6 +184,7 @@ public function __construct($objElement, $strColumn = 'main') * @SuppressWarnings(PHPMD.CamelCaseVariableName) * @throws \Doctrine\DBAL\Exception */ + #[\Override] public function generate() { $scopeMatcher = System::getContainer()->get('contao.routing.scope_matcher'); diff --git a/src/FrontendIntegration/ViewCombinations.php b/src/FrontendIntegration/ViewCombinations.php index 747993c9c..9c0c9d737 100644 --- a/src/FrontendIntegration/ViewCombinations.php +++ b/src/FrontendIntegration/ViewCombinations.php @@ -39,6 +39,7 @@ class ViewCombinations extends \MetaModels\Helper\ViewCombinations * * @return bool */ + #[\Override] protected function authenticateUser() { return System::getContainer()->get('contao.security.token_checker')->hasFrontendUser(); @@ -47,6 +48,7 @@ protected function authenticateUser() /** * {@inheritdoc} */ + #[\Override] protected function getUserGroups() { // Special case in combinations, anonymous frontend users have the implicit group id -1. diff --git a/src/Helper/ToolboxFile.php b/src/Helper/ToolboxFile.php index af3f0a4b6..4820633f1 100644 --- a/src/Helper/ToolboxFile.php +++ b/src/Helper/ToolboxFile.php @@ -3,7 +3,7 @@ /** * This file is part of MetaModels/core. * - * (c) 2012-2025 The MetaModels team. + * (c) 2012-2026 The MetaModels team. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -20,7 +20,7 @@ * @author Ingolf Steinhardt * @author Sven Baumann * @author Andreas Fischer - * @copyright 2012-2025 The MetaModels team. + * @copyright 2012-2026 The MetaModels team. * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later * @filesource */ @@ -802,6 +802,10 @@ protected function sortByIdList($sortIds) $fileKeys = array_flip(array_keys($this->uuidMap)); $sorted = []; foreach ($sortIds as $sortStringId) { + if (!isset($fileKeys[$sortStringId])) { + continue; + } + $key = $fileKeys[$sortStringId]; $sorted[$key] = $fileMap[$key]; unset($fileMap[$key]); @@ -1107,7 +1111,7 @@ private function addFileModels(Collection $files, array $skipPaths = []): void if (isset($meta[$baseLanguage])) { $this->metaInformation[dirname($path)][basename($path)] = $meta[$baseLanguage]; - } elseif (isset($meta[$fallbackLanguage]) && null !== $fallbackLanguage) { + } elseif (null !== $fallbackLanguage && isset($meta[$fallbackLanguage])) { $this->metaInformation[dirname($path)][basename($path)] = $meta[$fallbackLanguage]; } } diff --git a/src/IFactory.php b/src/IFactory.php index 5c39baf5d..f8481cf82 100644 --- a/src/IFactory.php +++ b/src/IFactory.php @@ -41,6 +41,7 @@ interface IFactory extends IServiceContainerAware * * @psalm-suppress DeprecatedInterface */ + #[\Override] public function getServiceContainer(); /** diff --git a/src/Information/AttributeInformation.php b/src/Information/AttributeInformation.php index cb5e04115..f66a0eabc 100644 --- a/src/Information/AttributeInformation.php +++ b/src/Information/AttributeInformation.php @@ -59,6 +59,7 @@ public function __construct(string $name, string $type, array $configuration = [ /** * {@inheritDoc} */ + #[\Override] public function getName(): string { return $this->name; @@ -67,6 +68,7 @@ public function getName(): string /** * {@inheritDoc} */ + #[\Override] public function getType(): string { return $this->type; diff --git a/src/Information/MetaModelCollection.php b/src/Information/MetaModelCollection.php index c9578d285..74b316fd4 100644 --- a/src/Information/MetaModelCollection.php +++ b/src/Information/MetaModelCollection.php @@ -36,6 +36,7 @@ class MetaModelCollection implements MetaModelCollectionInterface /** * {@inheritDoc} */ + #[\Override] public function getNames(): array { return array_keys($this->metaModels); @@ -44,6 +45,7 @@ public function getNames(): array /** * {@inheritDoc} */ + #[\Override] public function all(): array { return array_values($this->metaModels); @@ -70,6 +72,7 @@ public function add(MetaModelInformationInterface $information): void /** * {@inheritDoc} */ + #[\Override] public function has(string $name): bool { return array_key_exists($name, $this->metaModels); @@ -80,6 +83,7 @@ public function has(string $name): bool * * @throws \InvalidArgumentException When the MetaModel is not registered. */ + #[\Override] public function get(string $name): MetaModelInformationInterface { if (!$this->has($name)) { @@ -92,6 +96,7 @@ public function get(string $name): MetaModelInformationInterface /** * {@inheritDoc} */ + #[\Override] public function getIterator(): \Traversable { // Cannot "yield from" here as we have the names as key. diff --git a/src/Information/MetaModelCollectionInterface.php b/src/Information/MetaModelCollectionInterface.php index 2a319a617..2045565c1 100644 --- a/src/Information/MetaModelCollectionInterface.php +++ b/src/Information/MetaModelCollectionInterface.php @@ -67,5 +67,6 @@ public function get(string $name): MetaModelInformationInterface; * * @return \Traversable */ + #[\Override] public function getIterator(): \Traversable; } diff --git a/src/Information/MetaModelInformation.php b/src/Information/MetaModelInformation.php index 2e0a38cd0..4bb632ff5 100644 --- a/src/Information/MetaModelInformation.php +++ b/src/Information/MetaModelInformation.php @@ -58,6 +58,7 @@ public function __construct(string $name, array $configuration = []) /** * {@inheritDoc} */ + #[\Override] public function getName(): string { return $this->name; @@ -66,6 +67,7 @@ public function getName(): string /** * {@inheritDoc} */ + #[\Override] public function getAttributeNames(): array { return \array_keys($this->attributes); @@ -96,6 +98,7 @@ public function addAttribute(AttributeInformationInterface $attribute): void * * @throws \InvalidArgumentException When the attribute is not registered. */ + #[\Override] public function getAttribute(string $name): AttributeInformationInterface { if (!$this->hasAttribute($name)) { @@ -108,6 +111,7 @@ public function getAttribute(string $name): AttributeInformationInterface /** * {@inheritDoc} */ + #[\Override] public function hasAttribute(string $name): bool { return isset($this->attributes[$name]); @@ -116,6 +120,7 @@ public function hasAttribute(string $name): bool /** * {@inheritDoc} */ + #[\Override] public function getAttributes(): array { return \array_values($this->attributes); @@ -124,6 +129,7 @@ public function getAttributes(): array /** * {@inheritDoc} */ + #[\Override] public function getAttributesOfType(string $typeName): \Traversable { foreach ($this->attributes as $attribute) { diff --git a/src/InformationProvider/ContaoDatabaseBackedInformationProvider.php b/src/InformationProvider/ContaoDatabaseBackedInformationProvider.php index d74114500..1df098e74 100644 --- a/src/InformationProvider/ContaoDatabaseBackedInformationProvider.php +++ b/src/InformationProvider/ContaoDatabaseBackedInformationProvider.php @@ -51,6 +51,7 @@ public function __construct(Connection $connection) /** * {@inheritDoc} */ + #[\Override] public function getNames(): array { if ($this->connection->createSchemaManager()->tablesExist('tl_metamodel')) { @@ -71,6 +72,7 @@ public function getNames(): array * * @throws \RuntimeException On error. */ + #[\Override] public function getInformationFor(MetaModelInformation $information): void { $configuration = $this diff --git a/src/InformationProvider/MetaModelInformationCollector.php b/src/InformationProvider/MetaModelInformationCollector.php index 02e8c9cb8..9f2907ca9 100644 --- a/src/InformationProvider/MetaModelInformationCollector.php +++ b/src/InformationProvider/MetaModelInformationCollector.php @@ -51,6 +51,7 @@ public function __construct(array $providers) /** * {@inheritDoc} */ + #[\Override] public function getNames(): array { $nameLists = \array_values(\array_map( @@ -65,6 +66,7 @@ public function getNames(): array /** * {@inheritDoc} */ + #[\Override] public function getInformationFor(MetaModelInformation $information): void { foreach ($this->providers as $provider) { diff --git a/src/InsertTag/LiteralNode.php b/src/InsertTag/LiteralNode.php index a90b42af3..80e64003f 100644 --- a/src/InsertTag/LiteralNode.php +++ b/src/InsertTag/LiteralNode.php @@ -54,6 +54,7 @@ public function getValue(): string /** * {@inheritDoc} */ + #[\Override] public function asString(): string { return $this->getValue(); diff --git a/src/InsertTag/Node.php b/src/InsertTag/Node.php index 0f674db76..07b261f28 100644 --- a/src/InsertTag/Node.php +++ b/src/InsertTag/Node.php @@ -44,6 +44,7 @@ public function __construct(NodeInterface ...$parts) /** * {@inheritDoc} */ + #[\Override] public function getIterator(): Traversable { foreach ($this->parts as $part) { @@ -54,6 +55,7 @@ public function getIterator(): Traversable /** * {@inheritDoc} */ + #[\Override] public function asString(): string { return '{{' . \array_reduce( diff --git a/src/InsertTag/NodeList.php b/src/InsertTag/NodeList.php index 260a7154e..5a44bbcc3 100644 --- a/src/InsertTag/NodeList.php +++ b/src/InsertTag/NodeList.php @@ -51,6 +51,7 @@ public function __construct(NodeInterface ...$elements) /** * {@inheritDoc} */ + #[\Override] public function getIterator(): Traversable { foreach ($this->elements as $element) { @@ -61,6 +62,7 @@ public function getIterator(): Traversable /** * {@inheritDoc} */ + #[\Override] public function asString(): string { return array_reduce( diff --git a/src/Item.php b/src/Item.php index 44d502e24..39994e7f7 100644 --- a/src/Item.php +++ b/src/Item.php @@ -235,6 +235,7 @@ protected function isArrayEmpty($arrArray) * * @return mixed */ + #[\Override] public function get($strAttributeName) { return \array_key_exists($strAttributeName, $this->arrData) ? $this->arrData[$strAttributeName] : null; @@ -248,6 +249,7 @@ public function get($strAttributeName) * * @return IItem */ + #[\Override] public function set($strAttributeName, $varValue) { $this->arrData[$strAttributeName] = $varValue; @@ -260,6 +262,7 @@ public function set($strAttributeName, $varValue) * * @return IMetaModel the instance. */ + #[\Override] public function getMetaModel() { return $this->metaModel; @@ -272,6 +275,7 @@ public function getMetaModel() * * @return null|IAttribute the instance or null if not found. */ + #[\Override] public function getAttribute($strAttributeName) { return $this->getMetaModel()->getAttribute($strAttributeName); @@ -287,6 +291,7 @@ public function getAttribute($strAttributeName) * @return bool True means the data is set, on load of the item or at any time. * False means the attribute is not set. */ + #[\Override] public function isAttributeSet($strAttributeName) { return \array_key_exists($strAttributeName, $this->arrData); @@ -298,6 +303,7 @@ public function isAttributeSet($strAttributeName) * * @return array */ + #[\Override] public function getSetAttributes() { return \array_keys($this->arrData); @@ -308,6 +314,7 @@ public function getSetAttributes() * * @return bool True if it is a variant, false otherwise. */ + #[\Override] public function isVariant() { return $this->getMetaModel()->hasVariants() && ($this->arrData['varbase'] === '0'); @@ -322,6 +329,7 @@ public function isVariant() * * @return bool True if it is a variant base, false otherwise. */ + #[\Override] public function isVariantBase() { return $this->getMetaModel()->hasVariants() && ($this->arrData['varbase'] === '1'); @@ -334,6 +342,7 @@ public function isVariantBase() * * @return IItems|null A list of all variants for this item. */ + #[\Override] public function getVariants($objFilter) { if ($this->isVariantBase()) { @@ -350,6 +359,7 @@ public function getVariants($objFilter) * * @return IItem The variant base. */ + #[\Override] public function getVariantBase() { if ($this->getMetaModel()->hasVariants() && !$this->isVariantBase()) { @@ -389,6 +399,7 @@ public function getSiblings($objFilter) * * @return void */ + #[\Override] public function save($timestamp = null) { if (null === $timestamp) { @@ -449,6 +460,7 @@ protected function registerAssets($objSettings) * * @psalm-suppress InvalidArrayOffset */ + #[\Override] public function parseValue($strOutputFormat = 'text', $objSettings = null) { $this->registerAssets($objSettings); @@ -544,6 +556,7 @@ public function buildJumpToLink($objSettings) * * @return array format=>value */ + #[\Override] public function parseAttribute($strAttributeName, $strOutputFormat = 'text', $objSettings = null) { $attribute = $this->getAttribute($strAttributeName); @@ -561,6 +574,7 @@ public function parseAttribute($strAttributeName, $strOutputFormat = 'text', $ob * * @return IItem the new copy. */ + #[\Override] public function copy() { // Fetch data, clean undesired fields and return the new item. @@ -582,6 +596,7 @@ public function copy() * * @return \MetaModels\IItem the new copy. */ + #[\Override] public function varCopy() { $objNewItem = $this->copy(); diff --git a/src/Items.php b/src/Items.php index 15a4f85c0..87d6c530f 100644 --- a/src/Items.php +++ b/src/Items.php @@ -57,6 +57,7 @@ public function __construct($arrItems) /** * {@inheritDoc} */ + #[\Override] #[\ReturnTypeWillChange] public function rewind() { @@ -66,6 +67,7 @@ public function rewind() /** * {@inheritDoc} */ + #[\Override] #[\ReturnTypeWillChange] public function current() { @@ -75,6 +77,7 @@ public function current() /** * {@inheritDoc} */ + #[\Override] #[\ReturnTypeWillChange] public function key() { @@ -84,6 +87,7 @@ public function key() /** * {@inheritDoc} */ + #[\Override] #[\ReturnTypeWillChange] public function valid() { @@ -93,6 +97,7 @@ public function valid() /** * {@inheritDoc} */ + #[\Override] #[\ReturnTypeWillChange] public function offsetExists($offset) { @@ -102,6 +107,7 @@ public function offsetExists($offset) /** * {@inheritDoc} */ + #[\Override] #[\ReturnTypeWillChange] public function offsetGet($offset) { @@ -124,6 +130,7 @@ public function offsetGet($offset) * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ + #[\Override] #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { @@ -141,6 +148,7 @@ public function offsetSet($offset, $value) * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ + #[\Override] #[\ReturnTypeWillChange] public function offsetUnset($offset) { @@ -150,6 +158,7 @@ public function offsetUnset($offset) /** * {@inheritdoc} */ + #[\Override] public function getItem() { // Implicitly call first when not within "while ($obj->next())" scope. @@ -168,6 +177,7 @@ public function getItem() /** * {@inheritdoc} */ + #[\Override] public function getCount() { return \count($this->arrItems); @@ -176,6 +186,7 @@ public function getCount() /** * {@inheritdoc} */ + #[\Override] public function first() { if ($this->getCount() > 0) { @@ -193,6 +204,7 @@ public function first() * @psalm-suppress InvalidReturnStatement * @psalm-suppress InvalidFalsableReturnType */ + #[\Override] #[\ReturnTypeWillChange] public function next() { @@ -210,6 +222,7 @@ public function next() /** * {@inheritdoc} */ + #[\Override] public function prev() { if ($this->intCursor == 0) { @@ -224,6 +237,7 @@ public function prev() /** * {@inheritdoc} */ + #[\Override] public function last() { $this->intCursor = ($this->getCount() - 1); @@ -234,6 +248,7 @@ public function last() /** * {@inheritdoc} */ + #[\Override] public function reset() { $this->intCursor = -1; @@ -243,6 +258,7 @@ public function reset() /** * {@inheritdoc} */ + #[\Override] public function getClass() { $arrClass = []; @@ -266,6 +282,7 @@ public function getClass() /** * {@inheritdoc} */ + #[\Override] public function parseValue($strOutputFormat = 'text', $objSettings = null) { $item = $this->getItem(); @@ -279,6 +296,7 @@ public function parseValue($strOutputFormat = 'text', $objSettings = null) * * @SuppressWarnings(PHPMD.UnusedLocalVariable) */ + #[\Override] public function parseAll($strOutputFormat = 'text', $objSettings = null) { $arrResult = []; diff --git a/src/MetaModelsServiceContainer.php b/src/MetaModelsServiceContainer.php index 6628ccb21..a81b500f2 100644 --- a/src/MetaModelsServiceContainer.php +++ b/src/MetaModelsServiceContainer.php @@ -125,6 +125,7 @@ public function setFactory($factory) * * @deprecated The service container will get removed, use the symfony service container instead. */ + #[\Override] public function getFactory() { // @codingStandardsIgnoreStart @@ -161,6 +162,7 @@ public function setAttributeFactory($factory) * * @deprecated The service container will get removed, use the symfony service container instead. */ + #[\Override] public function getAttributeFactory() { // @codingStandardsIgnoreStart @@ -197,6 +199,7 @@ public function setFilterFactory($filterFactory) * * @deprecated The service container will get removed, use the symfony service container instead. */ + #[\Override] public function getFilterFactory() { // @codingStandardsIgnoreStart @@ -233,6 +236,7 @@ public function setRenderSettingFactory($renderFactory) * * @deprecated The service container will get removed, use the symfony service container instead. */ + #[\Override] public function getRenderSettingFactory() { // @codingStandardsIgnoreStart @@ -269,6 +273,7 @@ public function setEventDispatcher($dispatcher) * * @deprecated The service container will get removed, use the symfony service container instead. */ + #[\Override] public function getEventDispatcher() { // @codingStandardsIgnoreStart @@ -304,6 +309,7 @@ public function setDatabase($database) * * @deprecated The service container will get removed, use the symfony service container instead. */ + #[\Override] public function getDatabase() { // @codingStandardsIgnoreStart @@ -327,6 +333,7 @@ public function getDatabase() * * @deprecated The service container will get removed, use the symfony service container instead. */ + #[\Override] public function getCache() { // @codingStandardsIgnoreStart @@ -364,6 +371,7 @@ public function setCache($cache) * * @deprecated The service container will get removed, use the symfony service container instead. */ + #[\Override] public function setService($service, $serviceName = null) { // @codingStandardsIgnoreStart @@ -395,6 +403,7 @@ public function setService($service, $serviceName = null) * * @deprecated The service container will get removed, use the symfony service container instead. */ + #[\Override] public function getService($serviceName) { // @codingStandardsIgnoreStart diff --git a/src/Render/Setting/Collection.php b/src/Render/Setting/Collection.php index 2197d2da2..9f8370533 100644 --- a/src/Render/Setting/Collection.php +++ b/src/Render/Setting/Collection.php @@ -135,6 +135,7 @@ public function __construct( /** * {@inheritdoc} */ + #[\Override] public function get($strName) { return $this->arrBase[$strName] ?? null; @@ -143,6 +144,7 @@ public function get($strName) /** * {@inheritdoc} */ + #[\Override] public function set($strName, $varSetting) { $this->arrBase[$strName] = $varSetting; @@ -153,6 +155,7 @@ public function set($strName, $varSetting) /** * {@inheritdoc} */ + #[\Override] public function getSetting($strAttributeName) { return ($this->arrSettings[$strAttributeName] ?? null); @@ -161,6 +164,7 @@ public function getSetting($strAttributeName) /** * {@inheritdoc} */ + #[\Override] public function setSetting($strAttributeName, $objSetting) { if ($objSetting) { @@ -175,6 +179,7 @@ public function setSetting($strAttributeName, $objSetting) /** * {@inheritdoc} */ + #[\Override] public function getSettingNames() { return \array_keys($this->arrSettings); @@ -316,6 +321,7 @@ private function lookupJumpTo(bool $translated, string $desired = null, string $ /** * {@inheritdoc} */ + #[\Override] public function buildJumpToUrlFor(IItem $item /**, ?int $referenceType */) { $information = $this->determineJumpToInformation(); diff --git a/src/Render/Setting/RenderSettingFactory.php b/src/Render/Setting/RenderSettingFactory.php index 9a9a6ab2a..1898fe2a1 100644 --- a/src/Render/Setting/RenderSettingFactory.php +++ b/src/Render/Setting/RenderSettingFactory.php @@ -119,6 +119,7 @@ public function __construct( * * @psalm-suppress DeprecatedInterface */ + #[\Override] public function setServiceContainer(IMetaModelsServiceContainer $serviceContainer, $deprecationNotice = true) { if ($deprecationNotice) { @@ -164,6 +165,7 @@ public function setServiceContainer(IMetaModelsServiceContainer $serviceContaine * * @psalm-suppress DeprecatedInterface */ + #[\Override] public function getServiceContainer() { // @codingStandardsIgnoreStart @@ -270,6 +272,7 @@ protected function internalCreateRenderSetting(IMetaModel $metaModel, string|int /** * {@inheritdoc} */ + #[\Override] public function createCollection(IMetaModel $metaModel, $settingId = '') { $tableName = $metaModel->getTableName(); diff --git a/src/Render/Setting/Simple.php b/src/Render/Setting/Simple.php index a6c8379f5..52b7ef4b9 100644 --- a/src/Render/Setting/Simple.php +++ b/src/Render/Setting/Simple.php @@ -61,6 +61,7 @@ public function __construct($arrInformation = []) * * @return ISimple */ + #[\Override] public function setParent($parent) { $this->parent = $parent; @@ -73,6 +74,7 @@ public function setParent($parent) * * @return ICollection */ + #[\Override] public function getParent() { if (null === $this->parent) { @@ -89,6 +91,7 @@ public function getParent() * * @return mixed|null The value or null if not set. */ + #[\Override] public function get($strName) { return isset($this->arrBase[$strName]) ? $this->arrBase[$strName] : null; @@ -102,6 +105,7 @@ public function get($strName) * * @return ISimple The setting itself. */ + #[\Override] public function set($strName, $varSetting) { $this->arrBase[$strName] = $varSetting; @@ -113,6 +117,7 @@ public function set($strName, $varSetting) * * @return string[] */ + #[\Override] public function getKeys() { return \array_keys($this->arrBase); diff --git a/src/Schema/Doctrine/AbstractAttributeTypeSchemaGenerator.php b/src/Schema/Doctrine/AbstractAttributeTypeSchemaGenerator.php index b3035a5aa..8266ecaa4 100644 --- a/src/Schema/Doctrine/AbstractAttributeTypeSchemaGenerator.php +++ b/src/Schema/Doctrine/AbstractAttributeTypeSchemaGenerator.php @@ -35,6 +35,7 @@ abstract class AbstractAttributeTypeSchemaGenerator implements DoctrineSchemaGen /** * {@inheritDoc} */ + #[\Override] public function generate(DoctrineSchemaInformation $schema, MetaModelCollectionInterface $collection): void { $typeName = $this->getTypeName(); diff --git a/src/Schema/Doctrine/DoctrineSchemaGenerator.php b/src/Schema/Doctrine/DoctrineSchemaGenerator.php index 7fb80c98b..fee2739fd 100644 --- a/src/Schema/Doctrine/DoctrineSchemaGenerator.php +++ b/src/Schema/Doctrine/DoctrineSchemaGenerator.php @@ -50,6 +50,7 @@ public function __construct(array $providers) /** * {@inheritDoc} */ + #[\Override] public function generate(SchemaInformation $information, MetaModelCollectionInterface $collection): void { if (!$information->has(DoctrineSchemaInformation::class)) { diff --git a/src/Schema/Doctrine/DoctrineSchemaInformation.php b/src/Schema/Doctrine/DoctrineSchemaInformation.php index c788fab42..b9a1c64bc 100644 --- a/src/Schema/Doctrine/DoctrineSchemaInformation.php +++ b/src/Schema/Doctrine/DoctrineSchemaInformation.php @@ -61,6 +61,7 @@ public function __construct(?Schema $schema = null) /** * {@inheritDoc} */ + #[\Override] public function getName(): string { return static::class; diff --git a/src/Schema/Doctrine/DoctrineSchemaManager.php b/src/Schema/Doctrine/DoctrineSchemaManager.php index 3573079d1..a71e1185b 100644 --- a/src/Schema/Doctrine/DoctrineSchemaManager.php +++ b/src/Schema/Doctrine/DoctrineSchemaManager.php @@ -53,6 +53,7 @@ public function __construct(DoctrineSchemaManipulator $manipulator) * * @return void */ + #[\Override] public function preprocess(SchemaInformation $information): void { // If no information added, exit. @@ -74,6 +75,7 @@ public function preprocess(SchemaInformation $information): void * * @return void */ + #[\Override] public function process(SchemaInformation $information): void { // If no information added, exit. @@ -93,6 +95,7 @@ public function process(SchemaInformation $information): void * * @return void */ + #[\Override] public function postprocess(SchemaInformation $information): void { // If no information added, exit. @@ -111,6 +114,7 @@ public function postprocess(SchemaInformation $information): void /** * {@inheritDoc} */ + #[\Override] public function validate(SchemaInformation $information): array { // If no information added, exit. diff --git a/src/Schema/Doctrine/SystemColumnSchemaGenerator.php b/src/Schema/Doctrine/SystemColumnSchemaGenerator.php index 02eae5fb7..aab018413 100644 --- a/src/Schema/Doctrine/SystemColumnSchemaGenerator.php +++ b/src/Schema/Doctrine/SystemColumnSchemaGenerator.php @@ -35,6 +35,7 @@ class SystemColumnSchemaGenerator implements DoctrineSchemaGeneratorInterface /** * {@inheritDoc} */ + #[\Override] public function generate(DoctrineSchemaInformation $schema, MetaModelCollectionInterface $collection): void { foreach ($collection as $metaModelInformation) { diff --git a/src/Schema/LegacySchemaGenerator.php b/src/Schema/LegacySchemaGenerator.php index a7c60e6a2..d5b719af6 100644 --- a/src/Schema/LegacySchemaGenerator.php +++ b/src/Schema/LegacySchemaGenerator.php @@ -61,6 +61,7 @@ public function __construct(IFactory $factory, array $ignoredTypeNames) /** * {@inheritDoc} */ + #[\Override] public function generate(SchemaInformation $information, MetaModelCollectionInterface $collection): void { /** @psalm-suppress DeprecatedClass */ diff --git a/src/Schema/LegacySchemaInformation.php b/src/Schema/LegacySchemaInformation.php index c1b8e40a0..4ff10d336 100644 --- a/src/Schema/LegacySchemaInformation.php +++ b/src/Schema/LegacySchemaInformation.php @@ -40,6 +40,7 @@ class LegacySchemaInformation implements SchemaInformationInterface /** * {@inheritDoc} */ + #[\Override] public function getName(): string { return static::class; diff --git a/src/Schema/LegacySchemaManager.php b/src/Schema/LegacySchemaManager.php index d7e1fcbbf..28df2b472 100644 --- a/src/Schema/LegacySchemaManager.php +++ b/src/Schema/LegacySchemaManager.php @@ -34,6 +34,7 @@ class LegacySchemaManager implements SchemaManagerInterface /** * {@inheritDoc} */ + #[\Override] public function preprocess(SchemaInformation $information): void { // No-op. @@ -42,6 +43,7 @@ public function preprocess(SchemaInformation $information): void /** * {@inheritDoc} */ + #[\Override] public function process(SchemaInformation $information): void { /** @psalm-suppress DeprecatedClass */ @@ -97,6 +99,7 @@ public function process(SchemaInformation $information): void /** * {@inheritDoc} */ + #[\Override] public function postprocess(SchemaInformation $information): void { // No-op. @@ -105,6 +108,7 @@ public function postprocess(SchemaInformation $information): void /** * {@inheritDoc} */ + #[\Override] public function validate(SchemaInformation $information): array { /** @psalm-suppress DeprecatedClass */ diff --git a/src/Schema/SchemaGenerator.php b/src/Schema/SchemaGenerator.php index 1dcb56f02..6034b124f 100644 --- a/src/Schema/SchemaGenerator.php +++ b/src/Schema/SchemaGenerator.php @@ -48,6 +48,7 @@ public function __construct(array $generators) /** * {@inheritDoc} */ + #[\Override] public function generate(SchemaInformation $information, MetaModelCollectionInterface $collection): void { foreach ($this->generators as $manager) { diff --git a/src/Schema/SchemaManager.php b/src/Schema/SchemaManager.php index 0ecd506e2..b28087b37 100644 --- a/src/Schema/SchemaManager.php +++ b/src/Schema/SchemaManager.php @@ -46,6 +46,7 @@ public function __construct(array $managers) /** * {@inheritDoc} */ + #[\Override] public function preprocess(SchemaInformation $information): void { // pre process - this may perform data migrations and the like. @@ -57,6 +58,7 @@ public function preprocess(SchemaInformation $information): void /** * {@inheritDoc} */ + #[\Override] public function process(SchemaInformation $information): void { // process - here the automatic adjustments to the db will be made. @@ -68,6 +70,7 @@ public function process(SchemaInformation $information): void /** * {@inheritDoc} */ + #[\Override] public function postprocess(SchemaInformation $information): void { // post process - perform any cleanup to be done. @@ -79,6 +82,7 @@ public function postprocess(SchemaInformation $information): void /** * {@inheritDoc} */ + #[\Override] public function validate(SchemaInformation $information): array { $tasks = []; diff --git a/src/TranslatedMetaModel.php b/src/TranslatedMetaModel.php index 3641d0f07..532f066dd 100644 --- a/src/TranslatedMetaModel.php +++ b/src/TranslatedMetaModel.php @@ -85,6 +85,7 @@ public function __construct($arrData, EventDispatcherInterface $dispatcher, Conn /** * {@inheritdoc} */ + #[\Override] public function getLanguages(): array { return \array_keys((array) $this->arrData['languages']); @@ -93,6 +94,7 @@ public function getLanguages(): array /** * {@inheritDoc} */ + #[\Override] public function getMainLanguage(): string { return $this->mainLanguage; @@ -101,6 +103,7 @@ public function getMainLanguage(): string /** * {@inheritDoc} */ + #[\Override] public function getLanguage(): string { return $this->activeLanguage; @@ -109,6 +112,7 @@ public function getLanguage(): string /** * {@inheritdoc} */ + #[\Override] public function selectLanguage(string $activeLanguage): string { $previousLanguage = $this->getLanguage(); @@ -137,6 +141,7 @@ public function selectLanguage(string $activeLanguage): string * @SuppressWarnings(PHPMD.Superglobals) * @SuppressWarnings(PHPMD.CamelCaseVariableName) */ + #[\Override] protected function fetchTranslatedAttributeValues(ITranslated $attribute, $ids) { // @deprecated usage of TL_LANGUAGE - remove for Contao 5.0. diff --git a/src/Widgets/MultiTextWidget.php b/src/Widgets/MultiTextWidget.php index e54bfc3d8..f687d512a 100644 --- a/src/Widgets/MultiTextWidget.php +++ b/src/Widgets/MultiTextWidget.php @@ -53,6 +53,7 @@ class MultiTextWidget extends Widget * * @return void */ + #[\Override] public function __set($strKey, $varValue) { switch ($strKey) { @@ -88,6 +89,7 @@ public function __set($strKey, $varValue) * * @return mixed The processed value */ + #[\Override] protected function validator($varInput) { if (\is_array($varInput)) { @@ -108,6 +110,7 @@ protected function validator($varInput) * * @return string */ + #[\Override] public function generate() { $return = ''; diff --git a/src/Widgets/SubDcaWidget.php b/src/Widgets/SubDcaWidget.php index a64b7dc69..e3b0d350e 100644 --- a/src/Widgets/SubDcaWidget.php +++ b/src/Widgets/SubDcaWidget.php @@ -134,6 +134,7 @@ public function __construct($attributes = false) * * @return void */ + #[\Override] public function __set($strKey, $varValue) { switch ($strKey) { @@ -502,6 +503,7 @@ protected function validateWidget(&$arrField, $strRow, $strKey, &$varInput) * @SuppressWarnings(PHPMD.Superglobals) * @SuppressWarnings(PHPMD.CamelCaseVariableName) */ + #[\Override] protected function validator($varInput) { $blnHasError = false; @@ -599,6 +601,7 @@ protected function buildOptions() * @SuppressWarnings(PHPMD.Superglobals) * @SuppressWarnings(PHPMD.CamelCaseVariableName) */ + #[\Override] public function generate() { $GLOBALS['TL_CSS'][] = '/bundles/metamodelscore/css/style.css'; diff --git a/src/Widgets/TagsWidget.php b/src/Widgets/TagsWidget.php index 0cdef9575..3fb361558 100644 --- a/src/Widgets/TagsWidget.php +++ b/src/Widgets/TagsWidget.php @@ -47,6 +47,7 @@ class TagsWidget extends Widget /** * {@inheritDoc} */ + #[\Override] public function __set($strKey, $varValue) { switch ($strKey) { @@ -79,6 +80,7 @@ public function __set($strKey, $varValue) /** * {@inheritDoc} */ + #[\Override] protected function validator($varInput) { if (\is_array($varInput)) { @@ -156,6 +158,7 @@ protected function generateOption(array $val, int $index): string * @SuppressWarnings(PHPMD.Superglobals) * @SuppressWarnings(PHPMD.CamelCaseVariableName) */ + #[\Override] public function generate(): string { $return = \sprintf( diff --git a/tests/Attribute/AttributeFactoryTest.php b/tests/Attribute/AttributeFactoryTest.php index c8823ddb7..652141420 100644 --- a/tests/Attribute/AttributeFactoryTest.php +++ b/tests/Attribute/AttributeFactoryTest.php @@ -26,14 +26,12 @@ use MetaModels\Attribute\IAttributeFactory; use MetaModels\IMetaModelsServiceContainer; use MetaModels\MetaModelsEvents; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventDispatcherInterface; -/** - * Test the attribute factory. - * - * @covers \MetaModels\Attribute\AttributeFactory - */ +/** Test the attribute factory. */ +#[CoversClass(AttributeFactory::class)] class AttributeFactoryTest extends TestCase { /** @@ -41,24 +39,23 @@ class AttributeFactoryTest extends TestCase * * @return void */ - public function testCreateFactoryFiresEvent() + public function testCreateFactoryFiresEvent(): void { - $serviceContainer = $this->getMockForAbstractClass(IMetaModelsServiceContainer::class); + $serviceContainer = $this->getMockBuilder(IMetaModelsServiceContainer::class)->getMock(); - $eventDispatcher = $this->getMockForAbstractClass(EventDispatcherInterface::class); + $eventDispatcher = $this->getMockBuilder(EventDispatcherInterface::class)->getMock(); $eventDispatcher - ->expects(self::exactly(1)) + ->expects($this->once()) ->method('dispatch') - ->withConsecutive( - [ - self::isInstanceOf(CreateAttributeFactoryEvent::class), - self::equalTo(MetaModelsEvents::ATTRIBUTE_FACTORY_CREATE), - ] - ); + ->willReturnCallback(function (object $event, string $name) { + self::assertInstanceOf(CreateAttributeFactoryEvent::class, $event); + self::assertSame(MetaModelsEvents::ATTRIBUTE_FACTORY_CREATE, $name); + return $event; + }); $eventDispatcher - ->expects(self::exactly(1)) + ->expects($this->once()) ->method('hasListeners') - ->with(self::equalTo(MetaModelsEvents::ATTRIBUTE_FACTORY_CREATE)) + ->with(MetaModelsEvents::ATTRIBUTE_FACTORY_CREATE) ->willReturn(true); $factory = new AttributeFactory($eventDispatcher); @@ -72,9 +69,9 @@ public function testCreateFactoryFiresEvent() * * @return void */ - public function testAddTypeFactoryAndGetTypeFactory() + public function testAddTypeFactoryAndGetTypeFactory(): void { - $factory = new AttributeFactory($this->getMockForAbstractClass(EventDispatcherInterface::class)); + $factory = new AttributeFactory($this->getMockBuilder(EventDispatcherInterface::class)->getMock()); self::assertNull($factory->getTypeFactory('test')); $attributeFactory = $this->mockAttributeFactory('test', true, false, false); diff --git a/tests/Data/FilterBuilderSqlTest.php b/tests/Data/FilterBuilderSqlTest.php index f987c0092..ee8ca5f6b 100644 --- a/tests/Data/FilterBuilderSqlTest.php +++ b/tests/Data/FilterBuilderSqlTest.php @@ -23,14 +23,13 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\Result; use MetaModels\DcGeneral\Data\FilterBuilderSql; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; -/** - * Test the filter builder. - * - * @covers \MetaModels\DcGeneral\Data\FilterBuilderSql - */ +/** Test the filter builder. */ +#[CoversClass(FilterBuilderSql::class)] class FilterBuilderSqlTest extends TestCase { /** @@ -48,7 +47,7 @@ public function testBuilderIsInitiallyEmpty(): void /** * Data provider for testBuild() */ - public function buildTestProvider(): array + public static function buildTestProvider(): array { return [ 'equality compare' => [ @@ -85,9 +84,8 @@ public function buildTestProvider(): array * @param string $expectedSql The expected SQL query. * @param array $expectedParams The expected parameters. * @param array $filter The filter input array. - * - * @dataProvider buildTestProvider */ + #[DataProvider('buildTestProvider')] public function testBuild(string $expectedSql, array $expectedParams, array $filter): void { $connection = $this->mockConnection($expectedSql, $expectedParams, [['id' => 'succ'], ['id' => 'ess']]); @@ -157,11 +155,11 @@ private function mockConnection(string $queryString, array $params, array $resul ->disableOriginalConstructor() ->getMock(); $resultSet - ->expects(self::once()) + ->expects($this->once()) ->method('fetchAllAssociative') ->willReturn($result); $connection - ->expects(self::once()) + ->expects($this->once()) ->method('executeQuery') ->with($queryString, $params) ->willReturn($resultSet); diff --git a/tests/Data/FilterBuilderTest.php b/tests/Data/FilterBuilderTest.php index 155005769..c225967fe 100644 --- a/tests/Data/FilterBuilderTest.php +++ b/tests/Data/FilterBuilderTest.php @@ -177,7 +177,7 @@ public function testIssue700() $attribute = $this ->getMockBuilder(Base::class) ->setConstructorArgs([$metaModel, ['colname' => 'test1']]) - ->setMethods(['searchFor']) + ->onlyMethods(['searchFor']) ->getMockForAbstractClass(); $attribute diff --git a/tests/FactoryTest.php b/tests/FactoryTest.php index 7c299e4ed..c55de6fa4 100644 --- a/tests/FactoryTest.php +++ b/tests/FactoryTest.php @@ -47,12 +47,11 @@ public function testCreateMetaModelFiresEvent() $dispatcher ->expects(self::exactly(1)) ->method('dispatch') - ->withConsecutive( - [ - self::isInstanceOf(CreateMetaModelEvent::class), - self::equalTo(CreateMetaModelEvent::NAME) - ] - ); + ->willReturnCallback(function (object $event, string $name) { + self::assertInstanceOf(CreateMetaModelEvent::class, $event); + self::assertSame(CreateMetaModelEvent::NAME, $name); + return $event; + }); $factory->getMetaModel('mm_test'); } diff --git a/tests/Filter/FilterUrlBuilderTest.php b/tests/Filter/FilterUrlBuilderTest.php index a67aeb85a..2f760361a 100644 --- a/tests/Filter/FilterUrlBuilderTest.php +++ b/tests/Filter/FilterUrlBuilderTest.php @@ -22,16 +22,15 @@ use MetaModels\Filter\FilterUrl; use MetaModels\Filter\FilterUrlBuilder; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -/** - * This tests the filter url class. - * - * @covers \MetaModels\Filter\FilterUrlBuilder - */ +/** This tests the filter url class. */ +#[CoversClass(FilterUrlBuilder::class)] class FilterUrlBuilderTest extends TestCase { /** @@ -39,7 +38,7 @@ class FilterUrlBuilderTest extends TestCase * * @return array */ - public function generateProvider(): array + public static function generateProvider(): array { return [ 'test generating' => [ @@ -101,9 +100,8 @@ public function generateProvider(): array * @param string $requestUrl The current URL. * * @return void - * - * @dataProvider generateProvider */ + #[DataProvider('generateProvider')] public function testGenerate( string $expectedUrl, array $expectedParameters, @@ -124,7 +122,7 @@ public function testGenerate( ->getMock(); $generator - ->expects(self::once()) + ->expects($this->once()) ->method('generate') ->with($expectedUrl, $expectedParameters) ->willReturn('success'); @@ -150,7 +148,7 @@ public function testGeneratesNonStandardPorts(): void ->getMock(); $generator - ->expects(self::once()) + ->expects($this->once()) ->method('generate') ->with('tl_page.42', ['get2' => 'value', 'get-param' => 'get-value', 'parameters' => '/auto/slug/sluggy']) ->willReturn('success'); diff --git a/tests/Filter/Rules/Condition/ConditionAndTest.php b/tests/Filter/Rules/Condition/ConditionAndTest.php index cc5a5e508..3066cb960 100644 --- a/tests/Filter/Rules/Condition/ConditionAndTest.php +++ b/tests/Filter/Rules/Condition/ConditionAndTest.php @@ -22,13 +22,12 @@ use MetaModels\Filter\IFilter; use MetaModels\Filter\Rules\Condition\ConditionAnd; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; -/** - * Test AND condition filter rules. - * - * @covers \MetaModels\Filter\Rules\Condition\ConditionAnd - */ +/** Test AND condition filter rules. */ +#[CoversClass(ConditionAnd::class)] class ConditionAndTest extends TestCase { /** @@ -36,7 +35,7 @@ class ConditionAndTest extends TestCase * * @return array */ - public function provider() + public static function provider(): array { return array( array( @@ -77,10 +76,9 @@ public function provider() * @param array $filters The filter result values to add to the AND condition. * * @return void - * - * @dataProvider provider */ - public function testAndCondition($message, $expected, $filters) + #[DataProvider('provider')] + public function testAndCondition($message, $expected, $filters): void { $condition = new ConditionAnd(); foreach ($filters as $filter) { @@ -97,9 +95,9 @@ public function testAndCondition($message, $expected, $filters) * * @return IFilter */ - private function mockFilter($result) + private function mockFilter(?array $result): IFilter { - $filter = $this->getMockForAbstractClass(IFilter::class); + $filter = $this->getMockBuilder(IFilter::class)->getMock(); $filter->method('getMatchingIds')->willReturn($result); return $filter; diff --git a/tests/Filter/Rules/Condition/ConditionOrTest.php b/tests/Filter/Rules/Condition/ConditionOrTest.php index f5ad948d8..939db41bb 100644 --- a/tests/Filter/Rules/Condition/ConditionOrTest.php +++ b/tests/Filter/Rules/Condition/ConditionOrTest.php @@ -22,13 +22,12 @@ use MetaModels\Filter\IFilter; use MetaModels\Filter\Rules\Condition\ConditionOr; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; -/** - * Test OR condition filter rules. - * - * @covers \MetaModels\Filter\Rules\Condition\ConditionOr - */ +/** Test OR condition filter rules. */ +#[CoversClass(ConditionOr::class)] class ConditionOrTest extends TestCase { /** @@ -36,7 +35,7 @@ class ConditionOrTest extends TestCase * * @return array */ - public function provider() + public static function provider(): array { return array( array( @@ -77,10 +76,9 @@ public function provider() * @param array $filters The filter result values to add to the AND condition. * * @return void - * - * @dataProvider provider */ - public function testOrCondition($message, $expected, $filters) + #[DataProvider('provider')] + public function testOrCondition(string $message, ?array $expected, array $filters): void { $condition = new ConditionOr(); foreach ($filters as $filter) { @@ -97,9 +95,9 @@ public function testOrCondition($message, $expected, $filters) * * @return IFilter */ - private function mockFilter($result) + private function mockFilter(?array $result): IFilter { - $filter = $this->getMockForAbstractClass(IFilter::class); + $filter = $this->getMockBuilder(IFilter::class)->getMock(); $filter->method('getMatchingIds')->willReturn($result); return $filter; diff --git a/tests/Filter/Setting/CustomSqlTest.php b/tests/Filter/Setting/CustomSqlTest.php index 64508adef..c933300cb 100644 --- a/tests/Filter/Setting/CustomSqlTest.php +++ b/tests/Filter/Setting/CustomSqlTest.php @@ -38,6 +38,8 @@ use MetaModels\IMetaModel; use MetaModels\IMetaModelsServiceContainer; use MetaModels\Test\AutoLoadingTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use ReflectionProperty; use RuntimeException; use Symfony\Component\DependencyInjection\Container; @@ -51,14 +53,13 @@ /** * Unit test for testing the CustomSql filter setting. * - * @covers \MetaModels\Filter\Setting\CustomSql - * @covers \MetaModels\CoreBundle\Contao\InsertTag\ReplaceParam - * @covers \MetaModels\CoreBundle\Contao\InsertTag\ReplaceTableName - * * @SuppressWarnings(PHPMD.TooManyPublicMethods) * @SuppressWarnings(PHPMD.TooManyMethods) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ +#[CoversClass(CustomSql::class)] +#[CoversClass(ReplaceParam::class)] +#[CoversClass(ReplaceTableName::class)] class CustomSqlTest extends AutoLoadingTestCase { /** @@ -78,10 +79,10 @@ private function mockCustomSql( string $tableName = 'mm_unittest', array $services = [] ): CustomSql { - $metaModel = $this->getMockForAbstractClass(IMetaModel::class); + $metaModel = $this->getMockBuilder(IMetaModel::class)->getMock(); $metaModel->method('getTableName')->willReturn($tableName); - $filterSetting = $this->getMockForAbstractClass(ICollection::class); + $filterSetting = $this->getMockBuilder(ICollection::class)->getMock(); $filterSetting->method('getMetaModel')->willReturn($metaModel); if (!isset($services[InsertTagParser::class])) { @@ -627,84 +628,83 @@ public function testWithNullValueAndDefault(): void ); } - public function issue1495IfLangProvider(): Iterator + public static function issue1495IfLangProvider(): Iterator { yield [ 'sql' => '{{iflng::de}}1{{iflng::en}}3{{iflng::nl}}2{{iflng::es}}4{{iflng::el}}5{{iflng}}', 'language' => 'en', - 'exp_sql' => '3', + 'expectedSql' => '3', ]; yield [ 'sql' => '{{iflng::de}}1{{iflng::en}}3{{iflng::nl}}2{{iflng::es}}4{{iflng::el}}5{{iflng}}', 'language' => 'de', - 'exp_sql' => '1', + 'expectedSql' => '1', ]; yield [ 'sql' => '{{iflng::de}}1{{iflng::en}}3{{iflng::nl}}2{{iflng::es}}4{{iflng::el}}5{{iflng}}', 'language' => 'nl', - 'exp_sql' => '2', + 'expectedSql' => '2', ]; yield [ 'sql' => '{{iflng::de}}1{{iflng::en}}3{{iflng::nl}}2{{iflng::es}}4{{iflng::el}}5{{iflng}}', 'language' => 'es', - 'exp_sql' => '4', + 'expectedSql' => '4', ]; yield [ 'sql' => '{{iflng::de}}1{{iflng::en}}3{{iflng::nl}}2{{iflng::es}}4{{iflng::el}}5{{iflng}}', 'language' => 'el', - 'exp_sql' => '5', + 'expectedSql' => '5', ]; yield [ 'sql' => '{{iflng::de}}1{{iflng::en}}3{{iflng::nl}}2{{iflng::es}}4{{iflng::el}}5{{iflng}}', 'language' => 'cn', - 'exp_sql' => '', + 'expectedSql' => '', ]; yield [ 'sql' => '{{ifnlng::de}}1{{ifnlng::en}}3{{ifnlng::nl}}2{{ifnlng::es}}4{{ifnlng::el}}5{{iflng}}', 'language' => 'en', - 'exp_sql' => '1245', + 'expectedSql' => '1245', ]; yield [ 'sql' => '{{ifnlng::de}}1{{ifnlng::en}}3{{ifnlng::nl}}2{{ifnlng::es}}4{{ifnlng::el}}5{{iflng}}', 'language' => 'de', - 'exp_sql' => '3245', + 'expectedSql' => '3245', ]; yield [ 'sql' => '{{ifnlng::de}}1{{ifnlng::en}}3{{ifnlng::nl}}2{{ifnlng::es}}4{{ifnlng::el}}5{{iflng}}', 'language' => 'nl', - 'exp_sql' => '1345', + 'expectedSql' => '1345', ]; yield [ 'sql' => '{{ifnlng::de}}1{{ifnlng::en}}3{{ifnlng::nl}}2{{ifnlng::es}}4{{ifnlng::el}}5{{iflng}}', 'language' => 'es', - 'exp_sql' => '1325', + 'expectedSql' => '1325', ]; yield [ 'sql' => '{{ifnlng::de}}1{{ifnlng::en}}3{{ifnlng::nl}}2{{ifnlng::es}}4{{ifnlng::el}}5{{iflng}}', 'language' => 'el', - 'exp_sql' => '1324', + 'expectedSql' => '1324', ]; yield [ 'sql' => '{{ifnlng::de}}1{{ifnlng::en}}3{{ifnlng::nl}}2{{ifnlng::es}}4{{ifnlng::el}}5{{iflng}}', 'language' => 'cn', - 'exp_sql' => '13245', + 'expectedSql' => '13245', ]; yield [ 'sql' => 'SELECT id FROM {{table}} WHERE alias = {{iflng::de}}moe-yer-ss-hans-herbert-oeaeue' . '{{iflng::en}}3{{iflng::nl}}2{{iflng::es}}4{{iflng::el}}5{{iflng}}', 'language' => 'de', - 'exp_sql' => 'SELECT id FROM tableName + 'expectedSql' => 'SELECT id FROM tableName WHERE alias = moe-yer-ss-hans-herbert-oeaeue', ]; } /** * https://github.com/MetaModels/core/issues/1495 - * - * @dataProvider issue1495IfLangProvider */ + #[DataProvider('issue1495IfLangProvider')] public function testIssue1495IfLang(string $sql, string $language, string $expectedSql): void { $pageModel = $this diff --git a/tests/Helper/EmptyTestTest.php b/tests/Helper/EmptyTestTest.php index 131c2e46a..01706746d 100644 --- a/tests/Helper/EmptyTestTest.php +++ b/tests/Helper/EmptyTestTest.php @@ -20,13 +20,12 @@ namespace MetaModels\Test\Helper; use MetaModels\Helper\EmptyTest; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; -/** - * This tests the empty value check helper. - * - * @covers \MetaModels\Helper\EmptyTest - */ +/** This tests the empty value check helper. */ +#[CoversClass(EmptyTest::class)] class EmptyTestTest extends TestCase { /** @@ -34,7 +33,7 @@ class EmptyTestTest extends TestCase * * @return array */ - public function emptyValueTestProvider(): array + public static function emptyValueTestProvider(): array { return [ [ @@ -99,10 +98,9 @@ public function emptyValueTestProvider(): array * @param mixed $value The value to test. * * @return void - * - * @dataProvider emptyValueTestProvider */ - public function testEmptyValue($expected, $value): void + #[DataProvider('emptyValueTestProvider')] + public function testEmptyValue(bool $expected, mixed $value): void { $message = sprintf( ' %s === %s::isEmptyValue(%s)', diff --git a/tests/InformationProvider/MetaModelInformationCollectorTest.php b/tests/InformationProvider/MetaModelInformationCollectorTest.php index 19e9a1bd1..e1a5033a5 100644 --- a/tests/InformationProvider/MetaModelInformationCollectorTest.php +++ b/tests/InformationProvider/MetaModelInformationCollectorTest.php @@ -91,7 +91,7 @@ public function testGetCollection(): void { $collector = $this ->getMockBuilder(MetaModelInformationCollector::class) - ->setMethods(['getNames', 'getInformationFor']) + ->onlyMethods(['getNames', 'getInformationFor']) ->disableOriginalConstructor() ->getMock();