From 74a53b584e5299c620f05f3cf041f02be4070697 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Wed, 19 Jun 2024 11:25:44 +0200 Subject: [PATCH 01/28] chore: v12 --- .github/workflows/tests.yml | 4 +- .../Repository/FeatureFlagRepository.php | 4 +- Classes/System/Db/FeatureFlagData.php | 8 ++-- ...x_featureflag_domain_model_featureflag.php | 6 ++- .../Repository/FeatureFlagRepositoryTest.php | 37 ++++++------------- .../Repository/MappingRepositoryTest.php | 8 ++-- ...lagTest.shouldGetFeatureFlagByFlagName.csv | 3 ++ ...lagTest.shouldGetFeatureFlagByFlagName.xml | 9 ----- ...ntForBehaviorHideAndEnabledFeatureFlag.csv | 9 +++++ ...ntForBehaviorHideAndEnabledFeatureFlag.xml | 23 ------------ ...tForBehaviorShowAndDisabledFeatureFlag.csv | 9 +++++ ...tForBehaviorShowAndDisabledFeatureFlag.xml | 23 ------------ ...tForBehaviorHideAndDisabledFeatureFlag.csv | 9 +++++ ...tForBehaviorHideAndDisabledFeatureFlag.xml | 23 ------------ ...ntForBehaviorShowAndEnabledFeatureFlag.csv | 9 +++++ ...ntForBehaviorShowAndEnabledFeatureFlag.xml | 23 ------------ ...ngTest.findAllByForeignTableNameAndUid.csv | 4 ++ ...ngTest.findAllByForeignTableNameAndUid.xml | 16 -------- .../MappingTest.shouldGetHashedMappings.csv | 4 ++ .../MappingTest.shouldGetHashedMappings.xml | 16 -------- ...ntForBehaviorHideAndEnabledFeatureFlag.csv | 9 +++++ ...ntForBehaviorHideAndEnabledFeatureFlag.xml | 23 ------------ .../System/Db/FeatureFlagDataTest.php | 2 +- composer.json | 4 +- 24 files changed, 86 insertions(+), 199 deletions(-) create mode 100644 Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldGetFeatureFlagByFlagName.csv delete mode 100644 Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldGetFeatureFlagByFlagName.xml create mode 100644 Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldHideElementForBehaviorHideAndEnabledFeatureFlag.csv delete mode 100644 Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldHideElementForBehaviorHideAndEnabledFeatureFlag.xml create mode 100644 Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldHideElementForBehaviorShowAndDisabledFeatureFlag.csv delete mode 100644 Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldHideElementForBehaviorShowAndDisabledFeatureFlag.xml create mode 100644 Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldShowElementForBehaviorHideAndDisabledFeatureFlag.csv delete mode 100644 Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldShowElementForBehaviorHideAndDisabledFeatureFlag.xml create mode 100644 Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldShowElementForBehaviorShowAndEnabledFeatureFlag.csv delete mode 100644 Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldShowElementForBehaviorShowAndEnabledFeatureFlag.xml create mode 100644 Tests/Functional/Domain/Repository/fixtures/MappingTest.findAllByForeignTableNameAndUid.csv delete mode 100644 Tests/Functional/Domain/Repository/fixtures/MappingTest.findAllByForeignTableNameAndUid.xml create mode 100644 Tests/Functional/Domain/Repository/fixtures/MappingTest.shouldGetHashedMappings.csv delete mode 100644 Tests/Functional/Domain/Repository/fixtures/MappingTest.shouldGetHashedMappings.xml create mode 100644 Tests/Functional/Domain/Repository/fixtures/MappingTest.shouldHideElementForBehaviorHideAndEnabledFeatureFlag.csv delete mode 100644 Tests/Functional/Domain/Repository/fixtures/MappingTest.shouldHideElementForBehaviorHideAndEnabledFeatureFlag.xml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4159c0b..17c3d43 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,8 +10,8 @@ jobs: strategy: fail-fast: false matrix: - typo3: [ ^11.5 ] - php: [ '7.4', '8.0', '8.1', '8.2', '8.3' ] + typo3: [ ^12.4 ] + php: [ '8.0', '8.1', '8.2', '8.3' ] steps: - name: Checkout diff --git a/Classes/Domain/Repository/FeatureFlagRepository.php b/Classes/Domain/Repository/FeatureFlagRepository.php index 3bfb3fd..9dc4a49 100644 --- a/Classes/Domain/Repository/FeatureFlagRepository.php +++ b/Classes/Domain/Repository/FeatureFlagRepository.php @@ -29,7 +29,6 @@ use Aoe\FeatureFlag\Service\FeatureFlagService; use Aoe\FeatureFlag\System\Db\FeatureFlagData; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Extbase\Object\ObjectManager; use TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings; use TYPO3\CMS\Extbase\Persistence\Repository; @@ -40,8 +39,7 @@ class FeatureFlagRepository extends Repository public function __construct(FeatureFlagData $featureFlagData) { $this->featureFlagData = $featureFlagData; - $objectManager = GeneralUtility::makeInstance(ObjectManager::class); - parent::__construct($objectManager); + parent::__construct(); } public function initializeObject(): void diff --git a/Classes/System/Db/FeatureFlagData.php b/Classes/System/Db/FeatureFlagData.php index 9399374..a369c12 100644 --- a/Classes/System/Db/FeatureFlagData.php +++ b/Classes/System/Db/FeatureFlagData.php @@ -59,7 +59,7 @@ public function getContentElements(string $table, int $behavior, int $enabled): ->from(self::TABLE_FLAGS) ->where( $queryBuilder->expr() - ->andX( + ->and( $queryBuilder->expr() ->eq( self::TABLE_MAPPING . '.feature_flag', @@ -88,7 +88,7 @@ public function getContentElements(string $table, int $behavior, int $enabled): ) ); - return $queryBuilder->execute() + return $queryBuilder->executeQuery() ->fetchAllAssociative(); } @@ -106,7 +106,7 @@ public function updateContentElements(string $table, array $uids, bool $isVisibl ->set('hidden', $isVisible ? 0 : 1) ->add('where', $queryBuilder->expr()->in('uid', $uids)); - $query->execute(); + $query->executeStatement(); } public function getContentElementsPIDs(string $table, int $uid): string @@ -129,7 +129,7 @@ public function getContentElementsPIDs(string $table, int $uid): string ) ); - return $query->execute() + return $query->executeQuery() ->fetchOne(); } } diff --git a/Configuration/TCA/tx_featureflag_domain_model_featureflag.php b/Configuration/TCA/tx_featureflag_domain_model_featureflag.php index 75d528a..d2e31bb 100644 --- a/Configuration/TCA/tx_featureflag_domain_model_featureflag.php +++ b/Configuration/TCA/tx_featureflag_domain_model_featureflag.php @@ -21,7 +21,8 @@ 'config' => [ 'type' => 'input', 'size' => 30, - 'eval' => 'trim,required' + 'eval' => 'trim', + 'required' => true, ], ], 'flag' => [ @@ -30,7 +31,8 @@ 'config' => [ 'type' => 'input', 'size' => 30, - 'eval' => 'alphanum_x,trim,required,unique' + 'eval' => 'alphanum_x,trim,unique', + 'required' => true, ], ], 'enabled' => [ diff --git a/Tests/Functional/Domain/Repository/FeatureFlagRepositoryTest.php b/Tests/Functional/Domain/Repository/FeatureFlagRepositoryTest.php index 4dffd5e..9ab0e2f 100644 --- a/Tests/Functional/Domain/Repository/FeatureFlagRepositoryTest.php +++ b/Tests/Functional/Domain/Repository/FeatureFlagRepositoryTest.php @@ -55,86 +55,73 @@ protected function setUp(): void public function testShouldGetFeatureFlagByFlagName(): void { - $this->importDataSet(__DIR__ . '/fixtures/FeatureFlagTest.shouldGetFeatureFlagByFlagName.xml'); + $this->importCSVDataSet(__DIR__ . '/fixtures/FeatureFlagTest.shouldGetFeatureFlagByFlagName.csv'); $flag = $this->featureFlagRepository->findByFlag('my_test_feature_flag'); $this->assertInstanceOf(FeatureFlag::class, $flag); } public function testShouldHideElementForBehaviorHideAndEnabledFeatureFlag(): void { - $this->importDataSet( + $this->importCSVDataSet( __DIR__ . - '/fixtures/FeatureFlagTest.shouldHideElementForBehaviorHideAndEnabledFeatureFlag.xml' + '/fixtures/FeatureFlagTest.shouldHideElementForBehaviorHideAndEnabledFeatureFlag.csv' ); - $featureFlag = new FeatureFlagData(); $instance = new FeatureFlagRepository($featureFlag); $instance->updateFeatureFlagStatusForTable('tt_content'); $contentElements = $this->getElementsData('tt_content', 4712); - $this->assertSame(1, $contentElements[0]['hidden']); } public function testShouldHideElementForBehaviorShowAndDisabledFeatureFlag(): void { - $this->importDataSet( + $this->importCSVDataSet( __DIR__ . - '/fixtures/FeatureFlagTest.shouldHideElementForBehaviorShowAndDisabledFeatureFlag.xml' + '/fixtures/FeatureFlagTest.shouldHideElementForBehaviorShowAndDisabledFeatureFlag.csv' ); - $featureFlag = new FeatureFlagData(); $instance = new FeatureFlagRepository($featureFlag); $instance->updateFeatureFlagStatusForTable('tt_content'); $contentElements = $this->getElementsData('tt_content', 4712); - $this->assertSame(1, $contentElements[0]['hidden']); } public function testShouldShowElementForBehaviorShowAndEnabledFeatureFlag(): void { - $this->importDataSet( + $this->importCSVDataSet( __DIR__ . - '/fixtures/FeatureFlagTest.shouldShowElementForBehaviorShowAndEnabledFeatureFlag.xml' + '/fixtures/FeatureFlagTest.shouldShowElementForBehaviorShowAndEnabledFeatureFlag.csv' ); - $featureFlag = new FeatureFlagData(); $instance = new FeatureFlagRepository($featureFlag); $instance->updateFeatureFlagStatusForTable('tt_content'); $contentElements = $this->getElementsData('tt_content', 4712); - $this->assertSame(0, $contentElements[0]['hidden']); } public function testShouldShowElementForBehaviorHideAndDisabledFeatureFlag(): void { - $this->importDataSet( + $this->importCSVDataSet( __DIR__ . - '/fixtures/FeatureFlagTest.shouldShowElementForBehaviorShowAndEnabledFeatureFlag.xml' + '/fixtures/FeatureFlagTest.shouldShowElementForBehaviorShowAndEnabledFeatureFlag.csv' ); - $featureFlag = new FeatureFlagData(); $instance = new FeatureFlagRepository($featureFlag); $instance->updateFeatureFlagStatusForTable('tt_content'); $contentElements = $this->getElementsData('tt_content', 4712); - $this->assertSame(0, $contentElements[0]['hidden']); } - /** - * Helper function for testing return - * - * @param integer $uid - * @return array - */ - public function getElementsData(string $table, $uid) + + public function getElementsData(string $table, int $uid): array { /** @var QueryBuilder $queryBuilder */ $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) @@ -157,7 +144,7 @@ public function getElementsData(string $table, $uid) ) ); - return $query->execute() + return $query->executeQuery() ->fetchAllAssociative(); } } diff --git a/Tests/Functional/Domain/Repository/MappingRepositoryTest.php b/Tests/Functional/Domain/Repository/MappingRepositoryTest.php index 3be6021..581320b 100644 --- a/Tests/Functional/Domain/Repository/MappingRepositoryTest.php +++ b/Tests/Functional/Domain/Repository/MappingRepositoryTest.php @@ -51,9 +51,9 @@ protected function setUp(): void public function testFindOneByForeignTableNameAndUid(): void { - $this->importDataSet( + $this->importCSVDataSet( __DIR__ . - '/fixtures/MappingTest.shouldHideElementForBehaviorHideAndEnabledFeatureFlag.xml' + '/fixtures/MappingTest.shouldHideElementForBehaviorHideAndEnabledFeatureFlag.csv' ); $mapping = $this->mappingRepository->findOneByForeignTableNameAndUid(4712, 'tt_content'); @@ -63,7 +63,7 @@ public function testFindOneByForeignTableNameAndUid(): void public function testFindAllByForeignTableNameAndUid(): void { - $this->importDataSet(__DIR__ . '/fixtures/MappingTest.findAllByForeignTableNameAndUid.xml'); + $this->importCSVDataSet(__DIR__ . '/fixtures/MappingTest.findAllByForeignTableNameAndUid.csv'); $mapping = $this->mappingRepository->findAllByForeignTableNameAndUid( 4711, @@ -75,7 +75,7 @@ public function testFindAllByForeignTableNameAndUid(): void public function testShouldGetHashedMappings(): void { - $this->importDataSet(__DIR__ . '/fixtures/MappingTest.shouldGetHashedMappings.xml'); + $this->importCSVDataSet(__DIR__ . '/fixtures/MappingTest.shouldGetHashedMappings.csv'); $hashedMappings = $this->mappingRepository->getHashedMappings(); diff --git a/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldGetFeatureFlagByFlagName.csv b/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldGetFeatureFlagByFlagName.csv new file mode 100644 index 0000000..337c747 --- /dev/null +++ b/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldGetFeatureFlagByFlagName.csv @@ -0,0 +1,3 @@ +tx_featureflag_domain_model_featureflag,,,, +,uid,description,flag,enabled +,4711,"lorem ipsum",my_test_feature_flag,0 diff --git a/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldGetFeatureFlagByFlagName.xml b/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldGetFeatureFlagByFlagName.xml deleted file mode 100644 index 0e28e36..0000000 --- a/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldGetFeatureFlagByFlagName.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - 4711 - lorem ipsum - my_test_feature_flag - 0 - - \ No newline at end of file diff --git a/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldHideElementForBehaviorHideAndEnabledFeatureFlag.csv b/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldHideElementForBehaviorHideAndEnabledFeatureFlag.csv new file mode 100644 index 0000000..4ccdc40 --- /dev/null +++ b/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldHideElementForBehaviorHideAndEnabledFeatureFlag.csv @@ -0,0 +1,9 @@ +tx_featureflag_domain_model_featureflag,,,, +,uid,description,flag,enabled +,4711,"lorem ipsum",shouldHideElementForBehaviorHideAndEnabledFeatureFlag,1 +tt_content,,,, +,uid,bodytext,filelink_sorting,hidden +,4712,"lorem ipsum",,0 +tx_featureflag_domain_model_mapping,,,, +,feature_flag,foreign_table_uid,foreign_table_name,behavior +,4711,4712,tt_content,0 diff --git a/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldHideElementForBehaviorHideAndEnabledFeatureFlag.xml b/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldHideElementForBehaviorHideAndEnabledFeatureFlag.xml deleted file mode 100644 index f37dec6..0000000 --- a/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldHideElementForBehaviorHideAndEnabledFeatureFlag.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - 4711 - lorem ipsum - shouldHideElementForBehaviorHideAndEnabledFeatureFlag - 1 - - - - 4712 - lorem ipsum - - 0 - - - - 4711 - 4712 - tt_content - 0 - - \ No newline at end of file diff --git a/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldHideElementForBehaviorShowAndDisabledFeatureFlag.csv b/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldHideElementForBehaviorShowAndDisabledFeatureFlag.csv new file mode 100644 index 0000000..fa3ab91 --- /dev/null +++ b/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldHideElementForBehaviorShowAndDisabledFeatureFlag.csv @@ -0,0 +1,9 @@ +tx_featureflag_domain_model_featureflag,,,, +,uid,description,flag,enabled +,4711,"lorem ipsum",shouldHideElementForBehaviorHideAndEnabledFeatureFlag,0 +tt_content,,,, +,uid,bodytext,filelink_sorting,hidden +,4712,"lorem ipsum",,0 +tx_featureflag_domain_model_mapping,,,, +,feature_flag,foreign_table_uid,foreign_table_name,behavior +,4711,4712,tt_content,1 diff --git a/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldHideElementForBehaviorShowAndDisabledFeatureFlag.xml b/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldHideElementForBehaviorShowAndDisabledFeatureFlag.xml deleted file mode 100644 index 7f1ab90..0000000 --- a/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldHideElementForBehaviorShowAndDisabledFeatureFlag.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - 4711 - lorem ipsum - shouldHideElementForBehaviorHideAndEnabledFeatureFlag - 0 - - - - 4712 - lorem ipsum - - 0 - - - - 4711 - 4712 - tt_content - 1 - - \ No newline at end of file diff --git a/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldShowElementForBehaviorHideAndDisabledFeatureFlag.csv b/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldShowElementForBehaviorHideAndDisabledFeatureFlag.csv new file mode 100644 index 0000000..a9b16cf --- /dev/null +++ b/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldShowElementForBehaviorHideAndDisabledFeatureFlag.csv @@ -0,0 +1,9 @@ +tx_featureflag_domain_model_featureflag,,,, +,uid,description,flag,enabled +,4711,"lorem ipsum",shouldHideElementForBehaviorHideAndEnabledFeatureFlag,0 +tt_content,,,, +,uid,bodytext,filelink_sorting,hidden +,4712,"lorem ipsum",,1 +tx_featureflag_domain_model_mapping,,,, +,feature_flag,foreign_table_uid,foreign_table_name,behavior +,4711,4712,tt_content,0 diff --git a/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldShowElementForBehaviorHideAndDisabledFeatureFlag.xml b/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldShowElementForBehaviorHideAndDisabledFeatureFlag.xml deleted file mode 100644 index bbe584b..0000000 --- a/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldShowElementForBehaviorHideAndDisabledFeatureFlag.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - 4711 - lorem ipsum - shouldHideElementForBehaviorHideAndEnabledFeatureFlag - 0 - - - - 4712 - lorem ipsum - - 1 - - - - 4711 - 4712 - tt_content - 0 - - \ No newline at end of file diff --git a/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldShowElementForBehaviorShowAndEnabledFeatureFlag.csv b/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldShowElementForBehaviorShowAndEnabledFeatureFlag.csv new file mode 100644 index 0000000..7c5415c --- /dev/null +++ b/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldShowElementForBehaviorShowAndEnabledFeatureFlag.csv @@ -0,0 +1,9 @@ +tx_featureflag_domain_model_featureflag,,,, +,uid,description,flag,enabled +,4711,"lorem ipsum",shouldHideElementForBehaviorHideAndEnabledFeatureFlag,1 +tt_content,,,, +,uid,bodytext,filelink_sorting,hidden +,4712,"lorem ipsum",,0 +tx_featureflag_domain_model_mapping,,,, +,feature_flag,foreign_table_uid,foreign_table_name,behavior +,4711,4712,tt_content,1 diff --git a/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldShowElementForBehaviorShowAndEnabledFeatureFlag.xml b/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldShowElementForBehaviorShowAndEnabledFeatureFlag.xml deleted file mode 100644 index dd8db23..0000000 --- a/Tests/Functional/Domain/Repository/fixtures/FeatureFlagTest.shouldShowElementForBehaviorShowAndEnabledFeatureFlag.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - 4711 - lorem ipsum - shouldHideElementForBehaviorHideAndEnabledFeatureFlag - 1 - - - - 4712 - lorem ipsum - - 0 - - - - 4711 - 4712 - tt_content - 1 - - \ No newline at end of file diff --git a/Tests/Functional/Domain/Repository/fixtures/MappingTest.findAllByForeignTableNameAndUid.csv b/Tests/Functional/Domain/Repository/fixtures/MappingTest.findAllByForeignTableNameAndUid.csv new file mode 100644 index 0000000..783c201 --- /dev/null +++ b/Tests/Functional/Domain/Repository/fixtures/MappingTest.findAllByForeignTableNameAndUid.csv @@ -0,0 +1,4 @@ +tx_featureflag_domain_model_mapping,,,, +,feature_flag,foreign_table_uid,foreign_table_name,behavior +,4711,4711,tt_content,0 +,4712,4711,tt_content,0 diff --git a/Tests/Functional/Domain/Repository/fixtures/MappingTest.findAllByForeignTableNameAndUid.xml b/Tests/Functional/Domain/Repository/fixtures/MappingTest.findAllByForeignTableNameAndUid.xml deleted file mode 100644 index 9504292..0000000 --- a/Tests/Functional/Domain/Repository/fixtures/MappingTest.findAllByForeignTableNameAndUid.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - 4711 - 4711 - tt_content - 0 - - - - 4712 - 4711 - tt_content - 0 - - \ No newline at end of file diff --git a/Tests/Functional/Domain/Repository/fixtures/MappingTest.shouldGetHashedMappings.csv b/Tests/Functional/Domain/Repository/fixtures/MappingTest.shouldGetHashedMappings.csv new file mode 100644 index 0000000..ff18a72 --- /dev/null +++ b/Tests/Functional/Domain/Repository/fixtures/MappingTest.shouldGetHashedMappings.csv @@ -0,0 +1,4 @@ +tx_featureflag_domain_model_mapping,,,, +,feature_flag,foreign_table_uid,foreign_table_name,behavior +,4711,4711,tt_content,0 +,4712,4712,tt_content,0 diff --git a/Tests/Functional/Domain/Repository/fixtures/MappingTest.shouldGetHashedMappings.xml b/Tests/Functional/Domain/Repository/fixtures/MappingTest.shouldGetHashedMappings.xml deleted file mode 100644 index 2bfe41e..0000000 --- a/Tests/Functional/Domain/Repository/fixtures/MappingTest.shouldGetHashedMappings.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - 4711 - 4711 - tt_content - 0 - - - - 4712 - 4712 - tt_content - 0 - - \ No newline at end of file diff --git a/Tests/Functional/Domain/Repository/fixtures/MappingTest.shouldHideElementForBehaviorHideAndEnabledFeatureFlag.csv b/Tests/Functional/Domain/Repository/fixtures/MappingTest.shouldHideElementForBehaviorHideAndEnabledFeatureFlag.csv new file mode 100644 index 0000000..4ccdc40 --- /dev/null +++ b/Tests/Functional/Domain/Repository/fixtures/MappingTest.shouldHideElementForBehaviorHideAndEnabledFeatureFlag.csv @@ -0,0 +1,9 @@ +tx_featureflag_domain_model_featureflag,,,, +,uid,description,flag,enabled +,4711,"lorem ipsum",shouldHideElementForBehaviorHideAndEnabledFeatureFlag,1 +tt_content,,,, +,uid,bodytext,filelink_sorting,hidden +,4712,"lorem ipsum",,0 +tx_featureflag_domain_model_mapping,,,, +,feature_flag,foreign_table_uid,foreign_table_name,behavior +,4711,4712,tt_content,0 diff --git a/Tests/Functional/Domain/Repository/fixtures/MappingTest.shouldHideElementForBehaviorHideAndEnabledFeatureFlag.xml b/Tests/Functional/Domain/Repository/fixtures/MappingTest.shouldHideElementForBehaviorHideAndEnabledFeatureFlag.xml deleted file mode 100644 index f37dec6..0000000 --- a/Tests/Functional/Domain/Repository/fixtures/MappingTest.shouldHideElementForBehaviorHideAndEnabledFeatureFlag.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - 4711 - lorem ipsum - shouldHideElementForBehaviorHideAndEnabledFeatureFlag - 1 - - - - 4712 - lorem ipsum - - 0 - - - - 4711 - 4712 - tt_content - 0 - - \ No newline at end of file diff --git a/Tests/Functional/System/Db/FeatureFlagDataTest.php b/Tests/Functional/System/Db/FeatureFlagDataTest.php index e41afa5..b32a891 100644 --- a/Tests/Functional/System/Db/FeatureFlagDataTest.php +++ b/Tests/Functional/System/Db/FeatureFlagDataTest.php @@ -108,7 +108,7 @@ public function getElementsData(string $table, $uid) ) ); - return $query->execute() + return $query->executeQuery() ->fetchAllAssociative(); } } diff --git a/composer.json b/composer.json index df41098..159fcc0 100644 --- a/composer.json +++ b/composer.json @@ -17,9 +17,9 @@ } ], "require": { - "php": "^7.4 || ^8.0", + "php": "^8.0", "ext-json": "*", - "typo3/cms-core": "^11.5", + "typo3/cms-core": "^11.5 || ^12.4", "typo3/cms-extbase": "*", "typo3/cms-scheduler": "*" }, From 9a85a7e6f19fcb07de291a55328a25fbbbb52092 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Wed, 19 Jun 2024 11:35:52 +0200 Subject: [PATCH 02/28] chore: v12 --- .github/workflows/tests.yml | 10 +++++----- Classes/Command/AbstractCommand.php | 2 +- Classes/Command/ActivateFeatureFlagCommand.php | 2 +- .../Command/DeactivateFeatureFlagCommand.php | 2 +- Classes/Command/ToggleRecordsCommand.php | 2 +- Classes/Domain/Model/FeatureFlag.php | 2 +- Classes/Domain/Model/Mapping.php | 2 +- .../Domain/Repository/FeatureFlagRepository.php | 2 +- Classes/Domain/Repository/MappingRepository.php | 2 +- .../Form/Element/AbstractFormSelectElement.php | 2 +- .../FeatureFlagBehaviourFormSelectElement.php | 2 +- .../Element/FeatureFlagFormSelectElement.php | 2 +- Classes/Form/Element/InfoTextElement.php | 2 +- .../Exception/FeatureNotFoundException.php | 2 +- Classes/Service/FeatureFlagService.php | 2 +- Classes/System/Db/FeatureFlagData.php | 2 +- Classes/System/Typo3/Configuration.php | 2 +- Classes/System/Typo3/TCA.php | 2 +- Classes/System/Typo3/TcaPostProcessor.php | 2 +- README.md | 17 +++++++++-------- .../Repository/FeatureFlagRepositoryTest.php | 2 +- .../Domain/Repository/MappingRepositoryTest.php | 2 +- .../System/Db/FeatureFlagDataTest.php | 2 +- .../System/Typo3/ConfigurationTest.php | 2 +- Tests/Functional/System/Typo3/TCATest.php | 2 +- Tests/Unit/BaseTestCase.php | 2 +- Tests/Unit/Command/AbstractCommandTestCase.php | 2 +- .../Command/ActivateFeatureFlagCommandTest.php | 2 +- .../DeactivateFeatureFlagCommandTest.php | 2 +- Tests/Unit/Command/ToggleRecordsCommandTest.php | 2 +- Tests/Unit/Domain/Model/FeatureFlagTest.php | 2 +- Tests/Unit/Domain/Model/MappingTest.php | 2 +- ...eatureFlagBehaviourFormSelectElementTest.php | 2 +- .../FeatureFlagFormSelectElementTest.php | 2 +- Tests/Unit/Service/FeatureFlagServiceTest.php | 2 +- composer.json | 2 +- ext_emconf.php | 4 ++-- 37 files changed, 50 insertions(+), 49 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 17c3d43..aa8f5f0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,13 +48,13 @@ jobs: run: find . -name \*.php ! -path "./.Build/*" ! -path "./scripts/*" ! -path "./typo3_src/*" | parallel --gnu php -d display_errors=stderr -l {} > /dev/null \; - name: Unit Tests without coverage - if: matrix.typo3 != '^11.5' || matrix.php != '8.3' + if: matrix.typo3 == '^12.4' || matrix.php != '8.3' run: | export "UNIT_XML"=.Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml .Build/bin/phpunit --colors -c $UNIT_XML Tests/Unit - name: Unit Tests with coverage - if: matrix.typo3 == '^11.5' && matrix.php == '8.3' + if: matrix.typo3 == '^12.4' && matrix.php == '8.3' run: | export "UNIT_XML"=.Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests-v10.xml .Build/bin/phpunit --coverage-filter Classes --coverage-clover=unittest-coverage.clover --colors -c $UNIT_XML Tests/Unit/ @@ -63,7 +63,7 @@ jobs: run: | export "FUNCTIONAL_XML"=.Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTests.xml .Build/bin/phpunit --colors -c $FUNCTIONAL_XML Tests/Functional - if: matrix.typo3 != '^11.5' || matrix.php != '8.3' + if: matrix.typo3 == '^12.4' || matrix.php != '8.3' env: typo3DatabaseHost: 127.0.0.1 typo3DatabaseName: typo3 @@ -74,7 +74,7 @@ jobs: run: | export "FUNCTIONAL_XML"=.Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTests-v10.xml find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo "Running functional test suite {}"; .Build/bin/phpunit --coverage-filter Classes --coverage-clover={}functionaltest-coverage.clover --colors -c $FUNCTIONAL_XML {}' - if: matrix.typo3 == '^11.5' && matrix.php == '8.3' + if: matrix.typo3 == '^12.4' && matrix.php == '8.3' env: typo3DatabaseHost: 127.0.0.1 typo3DatabaseName: typo3 @@ -83,6 +83,6 @@ jobs: - name: Upload functional coverage results to Scrutinizer uses: sudo-bot/action-scrutinizer@latest - if: matrix.typo3 == '^11.5' && matrix.php == '8.3' + if: matrix.typo3 == '^12.4' && matrix.php == '8.3' with: cli-args: "--format=php-clover functional-coverage.clover --revision=${{ github.event.pull_request.head.sha || github.sha }}" diff --git a/Classes/Command/AbstractCommand.php b/Classes/Command/AbstractCommand.php index 181580b..5c00869 100644 --- a/Classes/Command/AbstractCommand.php +++ b/Classes/Command/AbstractCommand.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Classes/Command/ActivateFeatureFlagCommand.php b/Classes/Command/ActivateFeatureFlagCommand.php index b6d8f6d..57be8d5 100644 --- a/Classes/Command/ActivateFeatureFlagCommand.php +++ b/Classes/Command/ActivateFeatureFlagCommand.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Classes/Command/DeactivateFeatureFlagCommand.php b/Classes/Command/DeactivateFeatureFlagCommand.php index a1a3e5a..6e9e55e 100644 --- a/Classes/Command/DeactivateFeatureFlagCommand.php +++ b/Classes/Command/DeactivateFeatureFlagCommand.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Classes/Command/ToggleRecordsCommand.php b/Classes/Command/ToggleRecordsCommand.php index 5aadefc..5df5d11 100644 --- a/Classes/Command/ToggleRecordsCommand.php +++ b/Classes/Command/ToggleRecordsCommand.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Classes/Domain/Model/FeatureFlag.php b/Classes/Domain/Model/FeatureFlag.php index 076c6c3..9d4fcf3 100644 --- a/Classes/Domain/Model/FeatureFlag.php +++ b/Classes/Domain/Model/FeatureFlag.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Classes/Domain/Model/Mapping.php b/Classes/Domain/Model/Mapping.php index bdac721..caf04f4 100644 --- a/Classes/Domain/Model/Mapping.php +++ b/Classes/Domain/Model/Mapping.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Classes/Domain/Repository/FeatureFlagRepository.php b/Classes/Domain/Repository/FeatureFlagRepository.php index 9dc4a49..54a0379 100644 --- a/Classes/Domain/Repository/FeatureFlagRepository.php +++ b/Classes/Domain/Repository/FeatureFlagRepository.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Classes/Domain/Repository/MappingRepository.php b/Classes/Domain/Repository/MappingRepository.php index e7cd262..1008181 100644 --- a/Classes/Domain/Repository/MappingRepository.php +++ b/Classes/Domain/Repository/MappingRepository.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Classes/Form/Element/AbstractFormSelectElement.php b/Classes/Form/Element/AbstractFormSelectElement.php index 403bcff..079fa08 100644 --- a/Classes/Form/Element/AbstractFormSelectElement.php +++ b/Classes/Form/Element/AbstractFormSelectElement.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Classes/Form/Element/FeatureFlagBehaviourFormSelectElement.php b/Classes/Form/Element/FeatureFlagBehaviourFormSelectElement.php index 9daedd3..68dc1d4 100644 --- a/Classes/Form/Element/FeatureFlagBehaviourFormSelectElement.php +++ b/Classes/Form/Element/FeatureFlagBehaviourFormSelectElement.php @@ -8,7 +8,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Classes/Form/Element/FeatureFlagFormSelectElement.php b/Classes/Form/Element/FeatureFlagFormSelectElement.php index 9b6a965..e1063e7 100644 --- a/Classes/Form/Element/FeatureFlagFormSelectElement.php +++ b/Classes/Form/Element/FeatureFlagFormSelectElement.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Classes/Form/Element/InfoTextElement.php b/Classes/Form/Element/InfoTextElement.php index fc1f42a..f589b26 100644 --- a/Classes/Form/Element/InfoTextElement.php +++ b/Classes/Form/Element/InfoTextElement.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Classes/Service/Exception/FeatureNotFoundException.php b/Classes/Service/Exception/FeatureNotFoundException.php index 8bd8443..b09b747 100644 --- a/Classes/Service/Exception/FeatureNotFoundException.php +++ b/Classes/Service/Exception/FeatureNotFoundException.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Classes/Service/FeatureFlagService.php b/Classes/Service/FeatureFlagService.php index 95f2c54..363c076 100644 --- a/Classes/Service/FeatureFlagService.php +++ b/Classes/Service/FeatureFlagService.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Classes/System/Db/FeatureFlagData.php b/Classes/System/Db/FeatureFlagData.php index a369c12..9865ebf 100644 --- a/Classes/System/Db/FeatureFlagData.php +++ b/Classes/System/Db/FeatureFlagData.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Classes/System/Typo3/Configuration.php b/Classes/System/Typo3/Configuration.php index d0158a3..5b99008 100644 --- a/Classes/System/Typo3/Configuration.php +++ b/Classes/System/Typo3/Configuration.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Classes/System/Typo3/TCA.php b/Classes/System/Typo3/TCA.php index bdd0676..4f6ff28 100644 --- a/Classes/System/Typo3/TCA.php +++ b/Classes/System/Typo3/TCA.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Classes/System/Typo3/TcaPostProcessor.php b/Classes/System/Typo3/TcaPostProcessor.php index 76f809b..af3b7e7 100644 --- a/Classes/System/Typo3/TcaPostProcessor.php +++ b/Classes/System/Typo3/TcaPostProcessor.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/README.md b/README.md index 201b6ba..93ef10f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Add ability to use feature flags for extensions and content elements ## Build information -[![Build Status](https://github.com/AOEpeople/TYPO3-Feature-Flag/workflows/CI/badge.svg?branch=main)](https://github.com/AOEpeople/TYPO3-Feature-Flag/actions) +[![Build Status](https://github.com/AOEpeople/TYPO3-Feature-Flag/actions/workflows/tests.yml/badge.svg)](https://github.com/AOEpeople/TYPO3-Feature-Flag/actions) [![Code Coverage](https://scrutinizer-ci.com/g/AOEpeople/TYPO3-Feature-Flag/badges/coverage.png?b=main)](https://scrutinizer-ci.com/g/AOEpeople/TYPO3-Feature-Flag/?branch=main) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/AOEpeople/TYPO3-Feature-Flag/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/AOEpeople/TYPO3-Feature-Flag/?branch=main) @@ -13,18 +13,19 @@ The documentation is available online at [docs.typo3.org][1]. You can download and install this extension from the [TER (TYPO3 Extension Repository)][1] or use composer. -```shell script +```sh composer require aoe/feature-flag ``` ## Versions and Support -| Release | TYPO3 | PHP | Fixes will contain -|----------|----------|---------|--------------------| -| 11.x.y | 11.5 | 7.4-8.1 | Features, Bugfixes, Security Updates -| 9.x.y | 9.5-10.4 | 7.2-7.4 | Security Updates -| 8.x.y | 8.7 | 7.2-7.4 | Security Updates -| 5.x.y | 7.6 | 5.5-5.6 | End of life +| Release | TYPO3 | PHP | Fixes will contain | +|---------|----------|---------|--------------------------------------| +| 12.x.y | 12.4 | 8.0-8.3 | Features, Bugfixes, Security Updates | +| 11.x.y | 11.5 | 7.4-8.1 | Security Updates | +| 9.x.y | 9.5-10.4 | 7.2-7.4 | Security Updates | +| 8.x.y | 8.7 | 7.2-7.4 | Security Updates | +| 5.x.y | 7.6 | 5.5-5.6 | End of life | ## Copyright / License diff --git a/Tests/Functional/Domain/Repository/FeatureFlagRepositoryTest.php b/Tests/Functional/Domain/Repository/FeatureFlagRepositoryTest.php index 9ab0e2f..68f2ffc 100644 --- a/Tests/Functional/Domain/Repository/FeatureFlagRepositoryTest.php +++ b/Tests/Functional/Domain/Repository/FeatureFlagRepositoryTest.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Tests/Functional/Domain/Repository/MappingRepositoryTest.php b/Tests/Functional/Domain/Repository/MappingRepositoryTest.php index 581320b..5fd4ee3 100644 --- a/Tests/Functional/Domain/Repository/MappingRepositoryTest.php +++ b/Tests/Functional/Domain/Repository/MappingRepositoryTest.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Tests/Functional/System/Db/FeatureFlagDataTest.php b/Tests/Functional/System/Db/FeatureFlagDataTest.php index b32a891..050226c 100644 --- a/Tests/Functional/System/Db/FeatureFlagDataTest.php +++ b/Tests/Functional/System/Db/FeatureFlagDataTest.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Tests/Functional/System/Typo3/ConfigurationTest.php b/Tests/Functional/System/Typo3/ConfigurationTest.php index 311f27a..cd49588 100644 --- a/Tests/Functional/System/Typo3/ConfigurationTest.php +++ b/Tests/Functional/System/Typo3/ConfigurationTest.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Tests/Functional/System/Typo3/TCATest.php b/Tests/Functional/System/Typo3/TCATest.php index cecf9c6..128ffc2 100644 --- a/Tests/Functional/System/Typo3/TCATest.php +++ b/Tests/Functional/System/Typo3/TCATest.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Tests/Unit/BaseTestCase.php b/Tests/Unit/BaseTestCase.php index f371617..a86f96e 100644 --- a/Tests/Unit/BaseTestCase.php +++ b/Tests/Unit/BaseTestCase.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Tests/Unit/Command/AbstractCommandTestCase.php b/Tests/Unit/Command/AbstractCommandTestCase.php index aff23c4..f6974a0 100644 --- a/Tests/Unit/Command/AbstractCommandTestCase.php +++ b/Tests/Unit/Command/AbstractCommandTestCase.php @@ -10,7 +10,7 @@ /*************************************************************** * Copyright notice * - * (c) 2022 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Tests/Unit/Command/ActivateFeatureFlagCommandTest.php b/Tests/Unit/Command/ActivateFeatureFlagCommandTest.php index 67fcb0e..ade4abc 100644 --- a/Tests/Unit/Command/ActivateFeatureFlagCommandTest.php +++ b/Tests/Unit/Command/ActivateFeatureFlagCommandTest.php @@ -7,7 +7,7 @@ /*************************************************************** * Copyright notice * - * (c) 2022 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Tests/Unit/Command/DeactivateFeatureFlagCommandTest.php b/Tests/Unit/Command/DeactivateFeatureFlagCommandTest.php index 096fca8..d599a5e 100644 --- a/Tests/Unit/Command/DeactivateFeatureFlagCommandTest.php +++ b/Tests/Unit/Command/DeactivateFeatureFlagCommandTest.php @@ -7,7 +7,7 @@ /*************************************************************** * Copyright notice * - * (c) 2022 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Tests/Unit/Command/ToggleRecordsCommandTest.php b/Tests/Unit/Command/ToggleRecordsCommandTest.php index 5850d21..c482e57 100644 --- a/Tests/Unit/Command/ToggleRecordsCommandTest.php +++ b/Tests/Unit/Command/ToggleRecordsCommandTest.php @@ -7,7 +7,7 @@ /*************************************************************** * Copyright notice * - * (c) 2022 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Tests/Unit/Domain/Model/FeatureFlagTest.php b/Tests/Unit/Domain/Model/FeatureFlagTest.php index 7e5f441..4d3433a 100644 --- a/Tests/Unit/Domain/Model/FeatureFlagTest.php +++ b/Tests/Unit/Domain/Model/FeatureFlagTest.php @@ -8,7 +8,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Tests/Unit/Domain/Model/MappingTest.php b/Tests/Unit/Domain/Model/MappingTest.php index 88ea65a..f88df95 100644 --- a/Tests/Unit/Domain/Model/MappingTest.php +++ b/Tests/Unit/Domain/Model/MappingTest.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Tests/Unit/Form/Element/FeatureFlagBehaviourFormSelectElementTest.php b/Tests/Unit/Form/Element/FeatureFlagBehaviourFormSelectElementTest.php index feb6895..cb3c282 100644 --- a/Tests/Unit/Form/Element/FeatureFlagBehaviourFormSelectElementTest.php +++ b/Tests/Unit/Form/Element/FeatureFlagBehaviourFormSelectElementTest.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Tests/Unit/Form/Element/FeatureFlagFormSelectElementTest.php b/Tests/Unit/Form/Element/FeatureFlagFormSelectElementTest.php index 057fad4..117bad7 100644 --- a/Tests/Unit/Form/Element/FeatureFlagFormSelectElementTest.php +++ b/Tests/Unit/Form/Element/FeatureFlagFormSelectElementTest.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/Tests/Unit/Service/FeatureFlagServiceTest.php b/Tests/Unit/Service/FeatureFlagServiceTest.php index f4e400d..21eb567 100644 --- a/Tests/Unit/Service/FeatureFlagServiceTest.php +++ b/Tests/Unit/Service/FeatureFlagServiceTest.php @@ -5,7 +5,7 @@ /*************************************************************** * Copyright notice * - * (c) 2021 AOE GmbH + * (c) 2024 AOE GmbH * * All rights reserved * diff --git a/composer.json b/composer.json index 159fcc0..37a727c 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "require": { "php": "^8.0", "ext-json": "*", - "typo3/cms-core": "^11.5 || ^12.4", + "typo3/cms-core": "^12.4", "typo3/cms-extbase": "*", "typo3/cms-scheduler": "*" }, diff --git a/ext_emconf.php b/ext_emconf.php index 7b4ad5e..d7562b0 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -11,10 +11,10 @@ 'uploadfolder' => 0, 'createDirs' => '', 'clearCacheOnLoad' => 0, - 'version' => '11.3.1', + 'version' => '12.0.0', 'constraints' => [ 'depends' => [ - 'typo3' => '11.5.0-11.5.99' + 'typo3' => '12.4.0-12-4.99' ], 'conflicts' => [], 'suggests' => [], From eb7a2a1d017cf13715bf5908dba123d1aaa20097 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Wed, 19 Jun 2024 14:04:41 +0200 Subject: [PATCH 03/28] refactor: code quality config --- .../configure-checkstyle.sh | 0 {.code-quality => code-quality}/ecs.php | 0 .../phpstan-baseline.neon | 0 {.code-quality => code-quality}/phpstan.neon | 0 {.code-quality => code-quality}/rector-8_0.php | 0 {.code-quality => code-quality}/rector.php | 0 composer.json | 18 +++++------------- 7 files changed, 5 insertions(+), 13 deletions(-) rename {.code-quality => code-quality}/configure-checkstyle.sh (100%) rename {.code-quality => code-quality}/ecs.php (100%) rename {.code-quality => code-quality}/phpstan-baseline.neon (100%) rename {.code-quality => code-quality}/phpstan.neon (100%) rename {.code-quality => code-quality}/rector-8_0.php (100%) rename {.code-quality => code-quality}/rector.php (100%) diff --git a/.code-quality/configure-checkstyle.sh b/code-quality/configure-checkstyle.sh similarity index 100% rename from .code-quality/configure-checkstyle.sh rename to code-quality/configure-checkstyle.sh diff --git a/.code-quality/ecs.php b/code-quality/ecs.php similarity index 100% rename from .code-quality/ecs.php rename to code-quality/ecs.php diff --git a/.code-quality/phpstan-baseline.neon b/code-quality/phpstan-baseline.neon similarity index 100% rename from .code-quality/phpstan-baseline.neon rename to code-quality/phpstan-baseline.neon diff --git a/.code-quality/phpstan.neon b/code-quality/phpstan.neon similarity index 100% rename from .code-quality/phpstan.neon rename to code-quality/phpstan.neon diff --git a/.code-quality/rector-8_0.php b/code-quality/rector-8_0.php similarity index 100% rename from .code-quality/rector-8_0.php rename to code-quality/rector-8_0.php diff --git a/.code-quality/rector.php b/code-quality/rector.php similarity index 100% rename from .code-quality/rector.php rename to code-quality/rector.php diff --git a/composer.json b/composer.json index 37a727c..e295ed2 100644 --- a/composer.json +++ b/composer.json @@ -67,12 +67,8 @@ ], "code-style": [ "[ -e ./.Build/bin/rector ] || composer install", - "./.Build/bin/ecs check --config .code-quality/ecs.php", - "./.Build/bin/rector process --dry-run --config .code-quality/rector.php" - ], - "code-style-upgrade": [ - "[ -e ./.Build/bin/rector ] || composer install", - "./.Build/bin/rector process --dry-run --config .code-quality/rector-8_0.php" + "./.Build/bin/ecs check --config code-quality/ecs.php", + "./.Build/bin/rector process --dry-run --config code-quality/rector.php" ], "code-analysis": [ "./.Build/bin/phpstan analyse -c .code-quality/phpstan.neon --memory-limit=1G" @@ -83,8 +79,7 @@ "code-compatibility": [ "[ -e ./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs ] || composer install", "[ -d ./reports/php_checkstyle ] || mkdir -p reports/php_checkstyle/", - "./.code-quality/configure-checkstyle.sh", - "./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs -d memory_limit=1G --standard=PHPCompatibility --colors --ignore=*/.Build/*,*.min.js -p . --runtime-set testVersion 7.4", + "./code-quality/configure-checkstyle.sh", "./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs -d memory_limit=1G --standard=PHPCompatibility --colors --ignore=*/.Build/*,*.min.js -p . --runtime-set testVersion 8.0", "./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs -d memory_limit=1G --standard=PHPCompatibility --colors --ignore=*/.Build/*,*.min.js -p . --runtime-set testVersion 8.1", "./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs -d memory_limit=1G --standard=PHPCompatibility --colors --ignore=*/.Build/*,*.min.js -p . --runtime-set testVersion 8.2", @@ -96,11 +91,8 @@ "@composer code-compatibility" ], "extension-release": [ - "rm -rf .Build", - "rm -rf .code-quality", - "rm -rf Tests/", - "rm .gitignore", - "rm .scrutinizer.yml" + "@composer install --no-dev", + "rm -rf .github .Build code-quality Tests .gitignore scrutinizer.yml" ] }, "scripts-descriptions": { From 8f40dc81b97b3e3c240d92e63e94ba74b3b3bf08 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Wed, 19 Jun 2024 14:13:01 +0200 Subject: [PATCH 04/28] chore: typo3 testing framework --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index aa8f5f0..143d73a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,9 +38,9 @@ jobs: - name: Validate composer.json and composer.lock run: composer validate - - name: Install dependencies with nimut/typo3-complete:${{ matrix.typo3 }} + - name: Install dependencies with typo3/testing-framework run: | - composer require --dev nimut/typo3-complete:${{ matrix.typo3 }} --no-progress + composer require --dev typo3/testing-framework --no-progress git checkout composer.json ln -nfs .Build/vendor/typo3/cms/typo3 typo3 From 85444f88e3707caa277cb646e0d205b338d2e3f7 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Wed, 19 Jun 2024 14:18:41 +0200 Subject: [PATCH 05/28] chore: PHP 8.1 required --- .github/workflows/tests.yml | 2 +- README.md | 2 +- composer.json | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 143d73a..ceaac07 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: fail-fast: false matrix: typo3: [ ^12.4 ] - php: [ '8.0', '8.1', '8.2', '8.3' ] + php: [ '8.1', '8.2', '8.3' ] steps: - name: Checkout diff --git a/README.md b/README.md index 93ef10f..dd36b9b 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ composer require aoe/feature-flag | Release | TYPO3 | PHP | Fixes will contain | |---------|----------|---------|--------------------------------------| -| 12.x.y | 12.4 | 8.0-8.3 | Features, Bugfixes, Security Updates | +| 12.x.y | 12.4 | 8.1-8.3 | Features, Bugfixes, Security Updates | | 11.x.y | 11.5 | 7.4-8.1 | Security Updates | | 9.x.y | 9.5-10.4 | 7.2-7.4 | Security Updates | | 8.x.y | 8.7 | 7.2-7.4 | Security Updates | diff --git a/composer.json b/composer.json index e295ed2..08796d9 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ } ], "require": { - "php": "^8.0", + "php": "^8.1", "ext-json": "*", "typo3/cms-core": "^12.4", "typo3/cms-extbase": "*", @@ -80,7 +80,6 @@ "[ -e ./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs ] || composer install", "[ -d ./reports/php_checkstyle ] || mkdir -p reports/php_checkstyle/", "./code-quality/configure-checkstyle.sh", - "./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs -d memory_limit=1G --standard=PHPCompatibility --colors --ignore=*/.Build/*,*.min.js -p . --runtime-set testVersion 8.0", "./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs -d memory_limit=1G --standard=PHPCompatibility --colors --ignore=*/.Build/*,*.min.js -p . --runtime-set testVersion 8.1", "./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs -d memory_limit=1G --standard=PHPCompatibility --colors --ignore=*/.Build/*,*.min.js -p . --runtime-set testVersion 8.2", "./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs -d memory_limit=1G --standard=PHPCompatibility --colors --ignore=*/.Build/*,*.min.js -p . --runtime-set testVersion 8.3" From 5294a395a3925ed7519d24361b6f3d525a6a2c66 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Wed, 19 Jun 2024 14:31:08 +0200 Subject: [PATCH 06/28] test: parent setup --- Tests/Unit/Domain/Model/FeatureFlagTest.php | 1 + Tests/Unit/Domain/Model/MappingTest.php | 1 + 2 files changed, 2 insertions(+) diff --git a/Tests/Unit/Domain/Model/FeatureFlagTest.php b/Tests/Unit/Domain/Model/FeatureFlagTest.php index 4d3433a..cc34aba 100644 --- a/Tests/Unit/Domain/Model/FeatureFlagTest.php +++ b/Tests/Unit/Domain/Model/FeatureFlagTest.php @@ -39,6 +39,7 @@ class FeatureFlagTest extends BaseTestCase */ protected function setUp(): void { + parent::setUp(); $this->featureFlag = new FeatureFlag(); } diff --git a/Tests/Unit/Domain/Model/MappingTest.php b/Tests/Unit/Domain/Model/MappingTest.php index f88df95..5e857cb 100644 --- a/Tests/Unit/Domain/Model/MappingTest.php +++ b/Tests/Unit/Domain/Model/MappingTest.php @@ -40,6 +40,7 @@ class MappingTest extends BaseTestCase */ protected function setUp(): void { + parent::setUp(); $this->mapping = new Mapping(); } From 19520be67781f72e5319fefd078c92deb18cbfab Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Wed, 19 Jun 2024 14:57:21 +0200 Subject: [PATCH 07/28] test: go to csv --- .../System/Db/FeatureFlagDataTest.php | 12 +++++----- .../Db/fixtures/FeatureFlagDataTest.csv | 9 +++++++ .../Db/fixtures/FeatureFlagDataTest.xml | 24 ------------------- 3 files changed, 15 insertions(+), 30 deletions(-) create mode 100644 Tests/Functional/System/Db/fixtures/FeatureFlagDataTest.csv delete mode 100644 Tests/Functional/System/Db/fixtures/FeatureFlagDataTest.xml diff --git a/Tests/Functional/System/Db/FeatureFlagDataTest.php b/Tests/Functional/System/Db/FeatureFlagDataTest.php index 050226c..a13bbb9 100644 --- a/Tests/Functional/System/Db/FeatureFlagDataTest.php +++ b/Tests/Functional/System/Db/FeatureFlagDataTest.php @@ -39,9 +39,9 @@ class FeatureFlagDataTest extends FunctionalTestCase public function testShouldGetContentElements(): void { - $this->importDataSet( + $this->importCSVDataSet( __DIR__ . - '/fixtures/FeatureFlagDataTest.xml' + '/fixtures/FeatureFlagDataTest.csv' ); $instance = new FeatureFlagData(); @@ -55,9 +55,9 @@ public function testShouldGetContentElements(): void public function testUpdateContentElements(): void { - $this->importDataSet( + $this->importCSVDataSet( __DIR__ . - '/fixtures/FeatureFlagDataTest.xml' + '/fixtures/FeatureFlagDataTest.csv' ); $instance = new FeatureFlagData(); @@ -71,9 +71,9 @@ public function testUpdateContentElements(): void public function testGetContentElementsPIDs(): void { - $this->importDataSet( + $this->importCSVDataSet( __DIR__ . - '/fixtures/FeatureFlagDataTest.xml' + '/fixtures/FeatureFlagDataTest.csv' ); $instance = new FeatureFlagData(); diff --git a/Tests/Functional/System/Db/fixtures/FeatureFlagDataTest.csv b/Tests/Functional/System/Db/fixtures/FeatureFlagDataTest.csv new file mode 100644 index 0000000..e1ccd29 --- /dev/null +++ b/Tests/Functional/System/Db/fixtures/FeatureFlagDataTest.csv @@ -0,0 +1,9 @@ +tx_featureflag_domain_model_featureflag,,,,, +,uid,pid,description,flag,enabled +,4711,1001,"lorem ipsum",shouldHideElementForBehaviorHideAndEnabledFeatureFlag,1 +tt_content,,,, +,uid,bodytext,filelink_sorting,hidden +,4712,"lorem ipsum",,0 +tx_featureflag_domain_model_mapping,,,, +,feature_flag,foreign_table_uid,foreign_table_name,behavior +,4711,4712,tt_content,0 diff --git a/Tests/Functional/System/Db/fixtures/FeatureFlagDataTest.xml b/Tests/Functional/System/Db/fixtures/FeatureFlagDataTest.xml deleted file mode 100644 index a20ed90..0000000 --- a/Tests/Functional/System/Db/fixtures/FeatureFlagDataTest.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - 4711 - 1001 - lorem ipsum - shouldHideElementForBehaviorHideAndEnabledFeatureFlag - 1 - - - - 4712 - lorem ipsum - - 0 - - - - 4711 - 4712 - tt_content - 0 - - \ No newline at end of file From 5b40fdfd6c4e0f10ede7b2ad36ecd45b9b3d3f83 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Thu, 20 Jun 2024 08:21:00 +0200 Subject: [PATCH 08/28] test: update testing framework and github workflows --- .github/workflows/tests.yml | 4 ++-- composer.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ceaac07..398fa4b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -56,7 +56,7 @@ jobs: - name: Unit Tests with coverage if: matrix.typo3 == '^12.4' && matrix.php == '8.3' run: | - export "UNIT_XML"=.Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests-v10.xml + export "UNIT_XML"=.Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml .Build/bin/phpunit --coverage-filter Classes --coverage-clover=unittest-coverage.clover --colors -c $UNIT_XML Tests/Unit/ - name: Functional Tests without coverage @@ -72,7 +72,7 @@ jobs: - name: Functional Tests with coverage run: | - export "FUNCTIONAL_XML"=.Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTests-v10.xml + export "FUNCTIONAL_XML"=.Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTests.xml find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo "Running functional test suite {}"; .Build/bin/phpunit --coverage-filter Classes --coverage-clover={}functionaltest-coverage.clover --colors -c $FUNCTIONAL_XML {}' if: matrix.typo3 == '^12.4' && matrix.php == '8.3' env: diff --git a/composer.json b/composer.json index 08796d9..d445bad 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "typo3/cms-scheduler": "*" }, "require-dev": { - "typo3/testing-framework": "^7.0.4", + "typo3/testing-framework": "^8.0.9", "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpcov": "*", "phpcompatibility/php-compatibility": "^9.3", From eb93fd1e24e0dea643e9777e56595f97cc1f58e6 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Thu, 20 Jun 2024 08:21:28 +0200 Subject: [PATCH 09/28] refactor: code style --- Tests/Functional/System/Db/FeatureFlagDataTest.php | 5 +---- Tests/Unit/Domain/Model/MappingTest.php | 14 +++++++------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Tests/Functional/System/Db/FeatureFlagDataTest.php b/Tests/Functional/System/Db/FeatureFlagDataTest.php index a13bbb9..1effd9b 100644 --- a/Tests/Functional/System/Db/FeatureFlagDataTest.php +++ b/Tests/Functional/System/Db/FeatureFlagDataTest.php @@ -82,10 +82,7 @@ public function testGetContentElementsPIDs(): void $this->assertSame('1001', $returnedPID); } - /** - * @return array - */ - public function getElementsData(string $table, $uid) + public function getElementsData(string $table, int $uid): array { /** @var QueryBuilder $queryBuilder */ $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) diff --git a/Tests/Unit/Domain/Model/MappingTest.php b/Tests/Unit/Domain/Model/MappingTest.php index 5e857cb..d417e99 100644 --- a/Tests/Unit/Domain/Model/MappingTest.php +++ b/Tests/Unit/Domain/Model/MappingTest.php @@ -32,7 +32,7 @@ class MappingTest extends BaseTestCase { - private ?\Aoe\FeatureFlag\Domain\Model\Mapping $mapping = null; + private ?Mapping $mapping = null; /** * (non-PHPdoc) @@ -57,13 +57,13 @@ protected function tearDown(): void public function testTstamp(): void { $this->mapping->setTstamp(2183466346); - $this->assertEquals($this->mapping->getTstamp(), 2183466346); + $this->assertEquals(2183466346, $this->mapping->getTstamp()); } public function testCrdate(): void { $this->mapping->setCrdate(2183466347); - $this->assertEquals($this->mapping->getCrdate(), 2183466347); + $this->assertEquals(2183466347, $this->mapping->getCrdate()); } public function testFeatureFlag(): void @@ -72,25 +72,25 @@ public function testFeatureFlag(): void $featureFlag->method('getFlag') ->willReturn('my_awesome_feature_flag'); $this->mapping->setFeatureFlag($featureFlag); - $this->assertEquals($this->mapping->getFeatureFlag()->getFlag(), 'my_awesome_feature_flag'); + $this->assertEquals('my_awesome_feature_flag', $this->mapping->getFeatureFlag()->getFlag()); } public function testForeignTableColumn(): void { $this->mapping->setForeignTableColumn('my_foreign_column'); - $this->assertEquals($this->mapping->getForeignTableColumn(), 'my_foreign_column'); + $this->assertEquals('my_foreign_column', $this->mapping->getForeignTableColumn()); } public function testForeignTableName(): void { $this->mapping->setForeignTableName('my_foreign_table'); - $this->assertEquals($this->mapping->getForeignTableName(), 'my_foreign_table'); + $this->assertEquals('my_foreign_table', $this->mapping->getForeignTableName()); } public function testForeignTableUid(): void { $this->mapping->setForeignTableUid(4711); - $this->assertEquals($this->mapping->getForeignTableUid(), 4711); + $this->assertEquals(4711, $this->mapping->getForeignTableUid()); } public function testBehavior(): void From 733006653b91b4d89d68aa15124f32459a709de1 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Thu, 20 Jun 2024 08:31:20 +0200 Subject: [PATCH 10/28] refactor: code style --- Classes/Command/AbstractCommand.php | 8 +++----- .../Domain/Repository/FeatureFlagRepository.php | 8 +++----- Classes/Service/FeatureFlagService.php | 15 +++------------ Classes/System/Typo3/Configuration.php | 2 +- Classes/System/Typo3/TcaPostProcessor.php | 2 +- .../Repository/FeatureFlagRepositoryTest.php | 1 - Tests/Unit/Command/AbstractCommandTestCase.php | 4 ++-- Tests/Unit/Domain/Model/FeatureFlagTest.php | 4 ++-- Tests/Unit/Domain/Model/MappingTest.php | 12 ++++++------ 9 files changed, 21 insertions(+), 35 deletions(-) diff --git a/Classes/Command/AbstractCommand.php b/Classes/Command/AbstractCommand.php index 5c00869..9974a6e 100644 --- a/Classes/Command/AbstractCommand.php +++ b/Classes/Command/AbstractCommand.php @@ -32,14 +32,12 @@ abstract class AbstractCommand extends Command { - protected FeatureFlagService $featureFlagService; - protected SymfonyStyle $inputOutput; - public function __construct(FeatureFlagService $featureFlagService) - { + public function __construct( + protected FeatureFlagService $featureFlagService + ) { parent::__construct(); - $this->featureFlagService = $featureFlagService; } /** diff --git a/Classes/Domain/Repository/FeatureFlagRepository.php b/Classes/Domain/Repository/FeatureFlagRepository.php index 54a0379..ff86295 100644 --- a/Classes/Domain/Repository/FeatureFlagRepository.php +++ b/Classes/Domain/Repository/FeatureFlagRepository.php @@ -34,11 +34,9 @@ class FeatureFlagRepository extends Repository { - private FeatureFlagData $featureFlagData; - - public function __construct(FeatureFlagData $featureFlagData) - { - $this->featureFlagData = $featureFlagData; + public function __construct( + private readonly FeatureFlagData $featureFlagData + ) { parent::__construct(); } diff --git a/Classes/Service/FeatureFlagService.php b/Classes/Service/FeatureFlagService.php index 363c076..331c2f1 100644 --- a/Classes/Service/FeatureFlagService.php +++ b/Classes/Service/FeatureFlagService.php @@ -44,22 +44,13 @@ class FeatureFlagService */ public const BEHAVIOR_SHOW = 1; - private FeatureFlagRepository $featureFlagRepository; - - private PersistenceManagerInterface $persistenceManager; - - private Configuration $configuration; - private array $cachedFlags = []; public function __construct( - FeatureFlagRepository $featureFlagRepository, - PersistenceManagerInterface $persistenceManager, - Configuration $configuration + private readonly FeatureFlagRepository $featureFlagRepository, + private readonly PersistenceManagerInterface $persistenceManager, + private readonly Configuration $configuration ) { - $this->featureFlagRepository = $featureFlagRepository; - $this->persistenceManager = $persistenceManager; - $this->configuration = $configuration; } public function isFeatureEnabled(string $flag): bool diff --git a/Classes/System/Typo3/Configuration.php b/Classes/System/Typo3/Configuration.php index 5b99008..6449f8e 100644 --- a/Classes/System/Typo3/Configuration.php +++ b/Classes/System/Typo3/Configuration.php @@ -49,7 +49,7 @@ public function __construct(ExtensionConfiguration $extensionConfiguration) public function getTables(): array { - return explode(',', $this->get(self::CONF_TABLES)); + return explode(',', (string) $this->get(self::CONF_TABLES)); } /** diff --git a/Classes/System/Typo3/TcaPostProcessor.php b/Classes/System/Typo3/TcaPostProcessor.php index af3b7e7..eac2835 100644 --- a/Classes/System/Typo3/TcaPostProcessor.php +++ b/Classes/System/Typo3/TcaPostProcessor.php @@ -87,7 +87,7 @@ private function getTcaTablesWithFeatureFlagSupport(): array $config = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('feature_flag'); if (isset($config['tables'])) { - return explode(',', $config['tables']); + return explode(',', (string) $config['tables']); } return []; diff --git a/Tests/Functional/Domain/Repository/FeatureFlagRepositoryTest.php b/Tests/Functional/Domain/Repository/FeatureFlagRepositoryTest.php index 68f2ffc..7510dea 100644 --- a/Tests/Functional/Domain/Repository/FeatureFlagRepositoryTest.php +++ b/Tests/Functional/Domain/Repository/FeatureFlagRepositoryTest.php @@ -120,7 +120,6 @@ public function testShouldShowElementForBehaviorHideAndDisabledFeatureFlag(): vo $this->assertSame(0, $contentElements[0]['hidden']); } - public function getElementsData(string $table, int $uid): array { /** @var QueryBuilder $queryBuilder */ diff --git a/Tests/Unit/Command/AbstractCommandTestCase.php b/Tests/Unit/Command/AbstractCommandTestCase.php index f6974a0..9513c27 100644 --- a/Tests/Unit/Command/AbstractCommandTestCase.php +++ b/Tests/Unit/Command/AbstractCommandTestCase.php @@ -85,7 +85,7 @@ protected function assertThatFeaturesAreNotActivated() protected function assertThatFeaturesAreDeactivated(array $expectedFeatures) { - $this->assertEquals($expectedFeatures, $this->deactivatedFeatures); + $this->assertSame($expectedFeatures, $this->deactivatedFeatures); } /** @@ -98,7 +98,7 @@ protected function assertThatFeaturesAreNotDeactivated() protected function assertThatInfosAreShown(array $expectedInfos) { - $this->assertEquals($expectedInfos, $this->shownInfos); + $this->assertSame($expectedInfos, $this->shownInfos); } protected function runCommand(string $commandClass, string $commaSeparatedListOfFeatures = '') diff --git a/Tests/Unit/Domain/Model/FeatureFlagTest.php b/Tests/Unit/Domain/Model/FeatureFlagTest.php index cc34aba..28ae636 100644 --- a/Tests/Unit/Domain/Model/FeatureFlagTest.php +++ b/Tests/Unit/Domain/Model/FeatureFlagTest.php @@ -59,7 +59,7 @@ public function testCheckProperties(): void $this->featureFlag->setEnabled(true); $this->featureFlag->setFlag('my_new_feature_flag'); $this->assertTrue($this->featureFlag->isEnabled()); - $this->assertEquals($this->featureFlag->getDescription(), 'This is a test description'); - $this->assertEquals($this->featureFlag->getFlag(), 'my_new_feature_flag'); + $this->assertSame('This is a test description', $this->featureFlag->getDescription()); + $this->assertSame('my_new_feature_flag', $this->featureFlag->getFlag()); } } diff --git a/Tests/Unit/Domain/Model/MappingTest.php b/Tests/Unit/Domain/Model/MappingTest.php index d417e99..1591f19 100644 --- a/Tests/Unit/Domain/Model/MappingTest.php +++ b/Tests/Unit/Domain/Model/MappingTest.php @@ -57,13 +57,13 @@ protected function tearDown(): void public function testTstamp(): void { $this->mapping->setTstamp(2183466346); - $this->assertEquals(2183466346, $this->mapping->getTstamp()); + $this->assertSame('2183466346', $this->mapping->getTstamp()); } public function testCrdate(): void { $this->mapping->setCrdate(2183466347); - $this->assertEquals(2183466347, $this->mapping->getCrdate()); + $this->assertSame('2183466347', $this->mapping->getCrdate()); } public function testFeatureFlag(): void @@ -72,25 +72,25 @@ public function testFeatureFlag(): void $featureFlag->method('getFlag') ->willReturn('my_awesome_feature_flag'); $this->mapping->setFeatureFlag($featureFlag); - $this->assertEquals('my_awesome_feature_flag', $this->mapping->getFeatureFlag()->getFlag()); + $this->assertSame('my_awesome_feature_flag', $this->mapping->getFeatureFlag()->getFlag()); } public function testForeignTableColumn(): void { $this->mapping->setForeignTableColumn('my_foreign_column'); - $this->assertEquals('my_foreign_column', $this->mapping->getForeignTableColumn()); + $this->assertSame('my_foreign_column', $this->mapping->getForeignTableColumn()); } public function testForeignTableName(): void { $this->mapping->setForeignTableName('my_foreign_table'); - $this->assertEquals('my_foreign_table', $this->mapping->getForeignTableName()); + $this->assertSame('my_foreign_table', $this->mapping->getForeignTableName()); } public function testForeignTableUid(): void { $this->mapping->setForeignTableUid(4711); - $this->assertEquals(4711, $this->mapping->getForeignTableUid()); + $this->assertSame(4711, $this->mapping->getForeignTableUid()); } public function testBehavior(): void From 09b2118c0f4eab7a90c9af41d7d8dec24af6b141 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Thu, 20 Jun 2024 13:12:31 +0200 Subject: [PATCH 11/28] fix: scrutinizer config --- .scrutinizer.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index f3e5a14..5febd27 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,6 +1,9 @@ build: nodes: analysis: + image: default-bionic + environment: + php: 8.3 tests: override: - php-scrutinizer-run From fdbeb67b915ba799918a40ca21e98ac5fdc53591 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Thu, 20 Jun 2024 13:26:56 +0200 Subject: [PATCH 12/28] fix: use existing exact php version --- .scrutinizer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 5febd27..bc982b5 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -3,7 +3,7 @@ build: analysis: image: default-bionic environment: - php: 8.3 + php: 8.3.8 tests: override: - php-scrutinizer-run From 8b4f80a76dcb1deb1dad4ef7e7feb3a4f1be1ab3 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Thu, 20 Jun 2024 13:31:16 +0200 Subject: [PATCH 13/28] fix: use existing exact php version --- .scrutinizer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index bc982b5..ed51821 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -3,7 +3,7 @@ build: analysis: image: default-bionic environment: - php: 8.3.8 + php: 8.3.0 tests: override: - php-scrutinizer-run From c772501bdef94cf6eecb668df6d9c1b411e97ecb Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Thu, 20 Jun 2024 14:31:36 +0200 Subject: [PATCH 14/28] fix: probably scrutinizer --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 398fa4b..f295d0e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -85,4 +85,4 @@ jobs: uses: sudo-bot/action-scrutinizer@latest if: matrix.typo3 == '^12.4' && matrix.php == '8.3' with: - cli-args: "--format=php-clover functional-coverage.clover --revision=${{ github.event.pull_request.head.sha || github.sha }}" + cli-args: "--format=php-clover .Build/reports/php_all_tests/coverage_clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}" \ No newline at end of file From e7ac1d128a1a5071c5f1af179e9f44f38b3665f2 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Thu, 20 Jun 2024 14:32:12 +0200 Subject: [PATCH 15/28] chore: update dependencies --- code-quality/phpstan-baseline.neon | 5 ----- code-quality/phpstan.neon | 6 ++++-- composer.json | 12 ++++++------ 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/code-quality/phpstan-baseline.neon b/code-quality/phpstan-baseline.neon index c0f6696..6741957 100644 --- a/code-quality/phpstan-baseline.neon +++ b/code-quality/phpstan-baseline.neon @@ -1,10 +1,5 @@ parameters: ignoreErrors: - - - message: "#^Method TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\QueryInterface\\:\\:logicalAnd\\(\\) invoked with 2 parameters, 1 required\\.$#" - count: 1 - path: ../Classes/Domain/Repository/MappingRepository.php - - message: "#^Constant LF not found\\.$#" count: 3 diff --git a/code-quality/phpstan.neon b/code-quality/phpstan.neon index 22d8534..b6b5bd0 100644 --- a/code-quality/phpstan.neon +++ b/code-quality/phpstan.neon @@ -8,9 +8,11 @@ parameters: paths: - "../Classes/" + ignoreErrors: + - identifier: missingType.iterableValue + - identifier: missingType.generics + inferPrivatePropertyTypeFromConstructor: true - checkMissingIterableValueType: false - checkGenericClassInNonGenericObjectType: false services: - diff --git a/composer.json b/composer.json index d445bad..c7e8cd0 100644 --- a/composer.json +++ b/composer.json @@ -25,13 +25,13 @@ }, "require-dev": { "typo3/testing-framework": "^8.0.9", + "phpunit/phpcov": "^9.0.0", "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpcov": "*", "phpcompatibility/php-compatibility": "^9.3", "phpstan/phpstan": "^1.10", "rector/rector": "^1.0", - "symplify/easy-coding-standard": "12.1.14", - "symplify/phpstan-rules": "12.4.8" + "symplify/easy-coding-standard": "^12.1", + "symplify/phpstan-rules": "^13.0.0" }, "autoload": { "psr-4": { @@ -71,10 +71,10 @@ "./.Build/bin/rector process --dry-run --config code-quality/rector.php" ], "code-analysis": [ - "./.Build/bin/phpstan analyse -c .code-quality/phpstan.neon --memory-limit=1G" + "./.Build/bin/phpstan analyse -c code-quality/phpstan.neon --memory-limit=1G" ], "code-analysis--baseline": [ - "./.Build/bin/phpstan analyse -c .code-quality/phpstan.neon --memory-limit=1G --generate-baseline" + "./.Build/bin/phpstan analyse -c code-quality/phpstan.neon --memory-limit=1G --generate-baseline" ], "code-compatibility": [ "[ -e ./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs ] || composer install", @@ -100,7 +100,7 @@ }, "extra": { "branch-alias": { - "dev-main": "11.1.x-dev" + "dev-main": "12.0.x-dev" }, "typo3/cms": { "cms-package-dir": "{$vendor-dir}/typo3/cms", From e164436b603413950a868dc20899d1d18f76c826 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Thu, 20 Jun 2024 17:21:43 +0200 Subject: [PATCH 16/28] docs: versions and support --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dd36b9b..38c7b9f 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,8 @@ composer require aoe/feature-flag |---------|----------|---------|--------------------------------------| | 12.x.y | 12.4 | 8.1-8.3 | Features, Bugfixes, Security Updates | | 11.x.y | 11.5 | 7.4-8.1 | Security Updates | -| 9.x.y | 9.5-10.4 | 7.2-7.4 | Security Updates | -| 8.x.y | 8.7 | 7.2-7.4 | Security Updates | +| 9.x.y | 9.5-10.4 | 7.2-7.4 | End of life | +| 8.x.y | 8.7 | 7.2-7.4 | End of life | | 5.x.y | 7.6 | 5.5-5.6 | End of life | ## Copyright / License From 897488163de6fb9e83a4f4bb9eba484fc004b32d Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Fri, 21 Jun 2024 09:25:20 +0200 Subject: [PATCH 17/28] test: process timeout --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index c7e8cd0..c42c8e4 100644 --- a/composer.json +++ b/composer.json @@ -47,6 +47,7 @@ "config": { "vendor-dir": ".Build/vendor", "bin-dir": ".Build/bin", + "process-timeout": 0, "allow-plugins": { "typo3/cms-composer-installers": true, "typo3/class-alias-loader": true From 4ef09b62a86139bbb7377443360fad0abeab3132 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Fri, 21 Jun 2024 09:34:07 +0200 Subject: [PATCH 18/28] Revert "test: process timeout" This reverts commit 897488163de6fb9e83a4f4bb9eba484fc004b32d. --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index c42c8e4..c7e8cd0 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,6 @@ "config": { "vendor-dir": ".Build/vendor", "bin-dir": ".Build/bin", - "process-timeout": 0, "allow-plugins": { "typo3/cms-composer-installers": true, "typo3/class-alias-loader": true From bfecd21ed91834b9b0b4aa963562a55ba7fa3a54 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Fri, 21 Jun 2024 13:08:47 +0200 Subject: [PATCH 19/28] test: back to no process timeout --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index c7e8cd0..c42c8e4 100644 --- a/composer.json +++ b/composer.json @@ -47,6 +47,7 @@ "config": { "vendor-dir": ".Build/vendor", "bin-dir": ".Build/bin", + "process-timeout": 0, "allow-plugins": { "typo3/cms-composer-installers": true, "typo3/class-alias-loader": true From 3726ef78de69e6b5351c906fe342268b9571b09f Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Fri, 21 Jun 2024 14:22:42 +0200 Subject: [PATCH 20/28] test: checks for PHP 8.4 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f295d0e..b7e26d9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: fail-fast: false matrix: typo3: [ ^12.4 ] - php: [ '8.1', '8.2', '8.3' ] + php: [ '8.1', '8.2', '8.3', '8.4' ] steps: - name: Checkout From 4a5e251d9ad0645c9f93f09efd0f697d062a11a0 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Fri, 21 Jun 2024 14:25:29 +0200 Subject: [PATCH 21/28] Revert "test: checks for PHP 8.4" This reverts commit 3726ef78de69e6b5351c906fe342268b9571b09f. --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b7e26d9..f295d0e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: fail-fast: false matrix: typo3: [ ^12.4 ] - php: [ '8.1', '8.2', '8.3', '8.4' ] + php: [ '8.1', '8.2', '8.3' ] steps: - name: Checkout From 2478b5167b0fbc557bd8cb2705ef749f1ea9e927 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Fri, 5 Jul 2024 13:41:45 +0200 Subject: [PATCH 22/28] docs: author --- ext_emconf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext_emconf.php b/ext_emconf.php index d7562b0..2f68c7c 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -4,7 +4,7 @@ 'title' => 'Feature Flags for TYPO3', 'description' => 'Add ability to use feature flags for extensions and content elements', 'category' => 'sys', - 'author' => 'Matthias Gutjahr, Kevin Schu', + 'author' => 'AOE GmbH', 'author_email' => 'dev@aoe.com', 'author_company' => 'AOE GmbH', 'state' => 'stable', From 0574ab5e000a6a7b03e3e1151fd8643c4efe3bf7 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Fri, 5 Jul 2024 13:42:25 +0200 Subject: [PATCH 23/28] test: show deprecations --- Tests/FunctionalTests.xml | 7 ++++++- Tests/UnitTests.xml | 7 ++++++- code-quality/rector-8_0.php | 30 ------------------------------ 3 files changed, 12 insertions(+), 32 deletions(-) delete mode 100644 code-quality/rector-8_0.php diff --git a/Tests/FunctionalTests.xml b/Tests/FunctionalTests.xml index 671e02a..c83050b 100644 --- a/Tests/FunctionalTests.xml +++ b/Tests/FunctionalTests.xml @@ -12,7 +12,12 @@ stopOnSkipped="false" cacheDirectory=".phpunit.cache" backupStaticProperties="false" - requireCoverageMetadata="false"> + requireCoverageMetadata="false" + displayDetailsOnTestsThatTriggerDeprecations="true" + displayDetailsOnTestsThatTriggerErrors="true" + displayDetailsOnTestsThatTriggerNotices="true" + displayDetailsOnTestsThatTriggerWarnings="true" +> ../Classes diff --git a/Tests/UnitTests.xml b/Tests/UnitTests.xml index 7aee5da..0d2562b 100644 --- a/Tests/UnitTests.xml +++ b/Tests/UnitTests.xml @@ -12,7 +12,12 @@ stopOnSkipped="false" cacheDirectory=".phpunit.cache" backupStaticProperties="false" - requireCoverageMetadata="false"> + requireCoverageMetadata="false" + displayDetailsOnTestsThatTriggerDeprecations="true" + displayDetailsOnTestsThatTriggerErrors="true" + displayDetailsOnTestsThatTriggerNotices="true" + displayDetailsOnTestsThatTriggerWarnings="true" +> ../Classes diff --git a/code-quality/rector-8_0.php b/code-quality/rector-8_0.php deleted file mode 100644 index 623b419..0000000 --- a/code-quality/rector-8_0.php +++ /dev/null @@ -1,30 +0,0 @@ -parameters(); - $parameters->set( - Option::PATHS, - [ - __DIR__ . '/../Classes', - __DIR__ . '/../Tests', - __DIR__ . '/rector.php', - __DIR__ . '/rector-8_0.php', - ] - ); - - $containerConfigurator->import(SetList::PHP_81); - - $parameters->set(Option::AUTO_IMPORT_NAMES, false); - $parameters->set(Option::AUTOLOAD_PATHS, [__DIR__ . '/../Classes']); - $parameters->set(Option::SKIP, []); - - $services = $containerConfigurator->services(); - $services->set(RemoveUnusedPrivatePropertyRector::class); -}; From a99381d87225666d3abd5bbaac58bab3d7e6617b Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Mon, 8 Jul 2024 07:48:00 +0200 Subject: [PATCH 24/28] chore: code style --- Classes/Command/AbstractCommand.php | 2 +- Tests/Unit/Command/AbstractCommandTestCase.php | 2 ++ code-quality/rector.php | 5 +---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Classes/Command/AbstractCommand.php b/Classes/Command/AbstractCommand.php index 9974a6e..e0d04ea 100644 --- a/Classes/Command/AbstractCommand.php +++ b/Classes/Command/AbstractCommand.php @@ -45,7 +45,7 @@ public function __construct( */ protected function setFeatureStatus(string $features, bool $enabled): void { - $features = array_map('trim', explode(',', $features)); + $features = array_map(trim(...), explode(',', $features)); foreach ($features as $feature) { $info = ($enabled) ? 'Activate' : 'Deactivate'; $this->showInfo($info . ' feature: ' . $feature); diff --git a/Tests/Unit/Command/AbstractCommandTestCase.php b/Tests/Unit/Command/AbstractCommandTestCase.php index 9513c27..18aca88 100644 --- a/Tests/Unit/Command/AbstractCommandTestCase.php +++ b/Tests/Unit/Command/AbstractCommandTestCase.php @@ -4,6 +4,7 @@ use Aoe\FeatureFlag\Service\FeatureFlagService; use Aoe\FeatureFlag\Tests\Unit\BaseTestCase; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\ArgvInput; use Symfony\Component\Console\Output\ConsoleOutput; @@ -126,6 +127,7 @@ protected function runCommand(string $commandClass, string $commaSeparatedListOf $this->callbackOnUpdateFeature($feature, $enabled); }); + /** @var Command $command */ $command = $this ->getMockBuilder($commandClass) ->setConstructorArgs([$featureFlagService]) diff --git a/code-quality/rector.php b/code-quality/rector.php index 6776034..52d1d17 100644 --- a/code-quality/rector.php +++ b/code-quality/rector.php @@ -5,10 +5,9 @@ use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector; use Rector\Config\RectorConfig; use Rector\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector; -use Rector\EarlyReturn\Rector\If_\ChangeAndIfToEarlyReturnRector; use Rector\Set\ValueObject\SetList; use Rector\PHPUnit\Set\PHPUnitSetList; -use Rector\Privatization\Rector\Class_\FinalizeClassesWithoutChildrenRector; + use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector; use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictSetUpRector; @@ -33,8 +32,6 @@ PHPUnitSetList::PHPUNIT_CODE_QUALITY ]) ->withSkip([ - FinalizeClassesWithoutChildrenRector::class, - ChangeAndIfToEarlyReturnRector::class, TypedPropertyFromStrictSetUpRector::class, AddMethodCallBasedStrictParamTypeRector::class, FlipTypeControlToUseExclusiveTypeRector::class, From 8a7cc234d3c1dcecff4df477d8cc115d484fe449 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Mon, 8 Jul 2024 08:39:18 +0200 Subject: [PATCH 25/28] chore: PHP 8.4 experimental --- .github/workflows/tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f295d0e..0faba82 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,6 +12,10 @@ jobs: matrix: typo3: [ ^12.4 ] php: [ '8.1', '8.2', '8.3' ] + include: + - typo3: ^12.4 + php: '8.4' + experimental: true steps: - name: Checkout From 72707a66f385857eef2bd88c67930561b1d10cbd Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Mon, 8 Jul 2024 08:48:04 +0200 Subject: [PATCH 26/28] Revert "chore: PHP 8.4 experimental" This reverts commit 8a7cc234d3c1dcecff4df477d8cc115d484fe449. --- .github/workflows/tests.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0faba82..f295d0e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,10 +12,6 @@ jobs: matrix: typo3: [ ^12.4 ] php: [ '8.1', '8.2', '8.3' ] - include: - - typo3: ^12.4 - php: '8.4' - experimental: true steps: - name: Checkout From be74270c5132ed8113d596eb2fcc90801a486a83 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Fri, 19 Jul 2024 09:53:58 +0200 Subject: [PATCH 27/28] fix: test config --- Tests/FunctionalTests.xml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Tests/FunctionalTests.xml b/Tests/FunctionalTests.xml index c83050b..1c9a035 100644 --- a/Tests/FunctionalTests.xml +++ b/Tests/FunctionalTests.xml @@ -23,17 +23,4 @@ ../Classes - - - - - - - - From 3b176be44fb3e80346336279b45ea1765824e7a5 Mon Sep 17 00:00:00 2001 From: Clemens Queissner Date: Fri, 30 Aug 2024 09:16:14 +0200 Subject: [PATCH 28/28] chore: Fixed minor code-styles. Prepare for first v12 release --- Tests/Functional/System/Typo3/TCATest.php | 5 +---- Tests/Unit/Service/FeatureFlagServiceTest.php | 12 +++--------- composer.json | 2 +- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/Tests/Functional/System/Typo3/TCATest.php b/Tests/Functional/System/Typo3/TCATest.php index 128ffc2..895e79e 100644 --- a/Tests/Functional/System/Typo3/TCATest.php +++ b/Tests/Functional/System/Typo3/TCATest.php @@ -38,10 +38,7 @@ class TCATest extends FunctionalTestCase { - /** - * @var TCA|MockObject - */ - protected $tca; + protected MockObject $tca; /** * (non-PHPdoc) diff --git a/Tests/Unit/Service/FeatureFlagServiceTest.php b/Tests/Unit/Service/FeatureFlagServiceTest.php index 21eb567..20a5d2e 100644 --- a/Tests/Unit/Service/FeatureFlagServiceTest.php +++ b/Tests/Unit/Service/FeatureFlagServiceTest.php @@ -115,10 +115,7 @@ protected function setService(FeatureFlagRepository $mockRepository) ); } - /** - * @return MockObject - */ - private function getMockModel($isEnabled) + private function getMockModel($isEnabled): MockObject { $mockModel = $this->getMockBuilder(FeatureFlag::class) ->disableOriginalConstructor() @@ -137,7 +134,7 @@ private function getMockModel($isEnabled) /** * @param boolean $isEnabled */ - private function getMockRepository($isEnabled) + private function getMockRepository($isEnabled): MockObject { $mockModel = $this->getMockModel($isEnabled); $mockRepository = $this->getMockBuilder(FeatureFlagRepository::class) @@ -148,10 +145,7 @@ private function getMockRepository($isEnabled) return $mockRepository; } - /** - * @return MockObject - */ - private function getMockConfiguration() + private function getMockConfiguration(): MockObject { $mockConfiguration = $this->getMockBuilder(Configuration::class) ->disableOriginalConstructor() diff --git a/composer.json b/composer.json index c42c8e4..7c4ea0b 100644 --- a/composer.json +++ b/composer.json @@ -78,7 +78,7 @@ "./.Build/bin/phpstan analyse -c code-quality/phpstan.neon --memory-limit=1G --generate-baseline" ], "code-compatibility": [ - "[ -e ./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs ] || composer install", + "[ -e ./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs ] || composer update", "[ -d ./reports/php_checkstyle ] || mkdir -p reports/php_checkstyle/", "./code-quality/configure-checkstyle.sh", "./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs -d memory_limit=1G --standard=PHPCompatibility --colors --ignore=*/.Build/*,*.min.js -p . --runtime-set testVersion 8.1",