[!!!][TASK] Replace ClassInfo with ClassSchema
[Packages/TYPO3.CMS.git] / typo3 / sysext / install / Classes / Configuration / FeatureManager.php
index 5c41b53..567b883 100644 (file)
@@ -15,6 +15,9 @@ namespace TYPO3\CMS\Install\Configuration;
  */
 
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Install\Configuration\Context\ContextFeature;
+use TYPO3\CMS\Install\Configuration\Image\ImageFeature;
+use TYPO3\CMS\Install\Configuration\Mail\MailFeature;
 
 /**
  * Instantiate and configure all known features and presets
@@ -24,23 +27,22 @@ class FeatureManager
     /**
      * @var array List of feature class names
      */
-    protected $featureRegistry = array(
-        \TYPO3\CMS\Install\Configuration\Context\ContextFeature::class,
-        \TYPO3\CMS\Install\Configuration\Image\ImageFeature::class,
-        \TYPO3\CMS\Install\Configuration\ExtbaseObjectCache\ExtbaseObjectCacheFeature::class,
-        \TYPO3\CMS\Install\Configuration\Mail\MailFeature::class,
-    );
+    protected $featureRegistry = [
+        ContextFeature::class,
+        ImageFeature::class,
+        MailFeature::class,
+    ];
 
     /**
      * Get initialized list of features with possible presets
      *
      * @param array $postValues List of $POST values
-     * @return array<FeatureInterface>
+     * @return FeatureInterface[]
      * @throws Exception
      */
-    public function getInitializedFeatures(array $postValues)
+    public function getInitializedFeatures(array $postValues = [])
     {
-        $features = array();
+        $features = [];
         foreach ($this->featureRegistry as $featureClass) {
             /** @var FeatureInterface $featureInstance */
             $featureInstance = GeneralUtility::makeInstance($featureClass);
@@ -65,7 +67,7 @@ class FeatureManager
      */
     public function getConfigurationForSelectedFeaturePresets(array $postValues)
     {
-        $localConfigurationValuesToSet = array();
+        $localConfigurationValuesToSet = [];
         $features = $this->getInitializedFeatures($postValues);
         foreach ($features as $feature) {
             /** @var FeatureInterface $feature */
@@ -96,8 +98,8 @@ class FeatureManager
      */
     public function getBestMatchingConfigurationForAllFeatures()
     {
-        $localConfigurationValuesToSet = array();
-        $features = $this->getInitializedFeatures(array());
+        $localConfigurationValuesToSet = [];
+        $features = $this->getInitializedFeatures([]);
         foreach ($features as $feature) {
             /** @var FeatureInterface $feature */
             $presets = $feature->getPresetsOrderedByPriority();