-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from AOEpeople/feature/TYPO3_12
feat: TYPO3 v12 compatibility
- Loading branch information
Showing
66 changed files
with
228 additions
and
421 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
build: | ||
nodes: | ||
analysis: | ||
image: default-bionic | ||
environment: | ||
php: 8.3.0 | ||
tests: | ||
override: | ||
- php-scrutinizer-run | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2021 AOE GmbH <[email protected]> | ||
* (c) 2024 AOE GmbH <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
|
@@ -32,22 +32,20 @@ | |
|
||
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; | ||
} | ||
|
||
/** | ||
* Enable or disable features. $features can be a comma-separated list of feature names | ||
*/ | ||
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); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2021 AOE GmbH <[email protected]> | ||
* (c) 2024 AOE GmbH <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2021 AOE GmbH <[email protected]> | ||
* (c) 2024 AOE GmbH <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2021 AOE GmbH <[email protected]> | ||
* (c) 2024 AOE GmbH <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2021 AOE GmbH <[email protected]> | ||
* (c) 2024 AOE GmbH <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2021 AOE GmbH <[email protected]> | ||
* (c) 2024 AOE GmbH <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2021 AOE GmbH <[email protected]> | ||
* (c) 2024 AOE GmbH <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
|
@@ -29,19 +29,15 @@ | |
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; | ||
|
||
class FeatureFlagRepository extends Repository | ||
{ | ||
private FeatureFlagData $featureFlagData; | ||
|
||
public function __construct(FeatureFlagData $featureFlagData) | ||
{ | ||
$this->featureFlagData = $featureFlagData; | ||
$objectManager = GeneralUtility::makeInstance(ObjectManager::class); | ||
parent::__construct($objectManager); | ||
public function __construct( | ||
private readonly FeatureFlagData $featureFlagData | ||
) { | ||
parent::__construct(); | ||
} | ||
|
||
public function initializeObject(): void | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2021 AOE GmbH <[email protected]> | ||
* (c) 2024 AOE GmbH <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2021 AOE GmbH <[email protected]> | ||
* (c) 2024 AOE GmbH <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2021 AOE GmbH <[email protected]> | ||
* (c) 2024 AOE GmbH <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2021 AOE GmbH <[email protected]> | ||
* (c) 2024 AOE GmbH <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2021 AOE GmbH <[email protected]> | ||
* (c) 2024 AOE GmbH <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2021 AOE GmbH <[email protected]> | ||
* (c) 2024 AOE GmbH <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2021 AOE GmbH <[email protected]> | ||
* (c) 2024 AOE GmbH <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2021 AOE GmbH <[email protected]> | ||
* (c) 2024 AOE GmbH <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
|
@@ -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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2021 AOE GmbH <[email protected]> | ||
* (c) 2024 AOE GmbH <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
|
@@ -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)); | ||
} | ||
|
||
/** | ||
|
Oops, something went wrong.