/** * @param FormFeature $value * @return \Pheat\Feature\FeatureInterface */ public function reverseTransform($value) { if (!$value instanceof FormFeature) { throw new TransformationFailedException('Invalid form feature'); } $provider = $this->manager->getProvider($value->provider); if (!$provider) { throw new TransformationFailedException('Invalid provider name'); } $factory = new Factory(); $feature = $factory->singleFragment($value->name, ['enabled' => $value->status, 'ratio' => $value->ratio, 'variants' => $value->variants], $provider); if (!$feature) { throw new TransformationFailedException('Invalid configuration fragment'); } return $feature; }