FluidTYPO3\Flux\Utility\CompatibilityRegistry::registerFeatureFlags PHP Method

registerFeatureFlags() public static method

public static registerFeatureFlags ( string $scope, array $versionedFeatureFlags, boolean $deprecationWarnings = FALSE ) : void
$scope string
$versionedFeatureFlags array
$deprecationWarnings boolean
return void
    public static function registerFeatureFlags($scope, array $versionedFeatureFlags, $deprecationWarnings = FALSE)
    {
        if (TRUE === $deprecationWarnings && NULL === static::resolveVersionedValue($versionedFeatureFlags, self::VERSION_DEFAULT)) {
            GeneralUtility::deprecationLog(sprintf('FluidTYPO3.Flux: CompatibilityRegistry was given versioned feature flags in scope %s but the versioned ' . 'values do not contain at least one set that applies on this version (%s)', $scope, static::resolveVersion(self::VERSION_DEFAULT)));
        }
        static::$featureFlags[$scope] = $versionedFeatureFlags;
    }

Usage Example

 /**
  * @param array $versionedValues
  * @param string $version
  * @param mixed $flag
  * @param mixed $expected
  * @test
  * @dataProvider getRegisterAndRetrieveFeatureFlagTestValues
  */
 public function testRegisterAndRetieveFeatureFlag(array $versionedValues, $version, $flag, $expected)
 {
     CompatibilityRegistry::registerFeatureFlags($scope, $versionedValues, FALSE);
     $this->assertEquals($expected, CompatibilityRegistry::hasFeatureFlag($scope, $flag, $version));
 }