namespace App\Entity\FeatureFlag;
use Doctrine\ORM\Mapping as ORM;
use HalloVerden\FeatureFlagBundle\Entity\FeatureFlag;
/**
* Class TestFeatureFlag
*
* @package App\Entity\FeatureFlag
*
* @ORM\Entity()
*/
class TestFeatureFlag extends FeatureFlag {
/* If you add additonal properties, override setFromConsole */
/**
* @inheritDoc
*/
public static function getType(): string {
return 'TEST';
}
}
namespace App\Services;
use App\Entity\FeatureFlag\TestFeatureFlag;
use HalloVerden\FeatureFlagBundle\Services\FeatureFlagServiceInterface;
class SomeService {
private FeatureFlagServiceInterface $featureFlagService;
public function __construct(FeatureFlagServiceInterface $featureFlagService) {
$this->featureFlagService = $featureFlagService;
}
public function test(): void {
if (!$this->featureFlagService->isActive(TestFeatureFlag::class)) {
return; // or throw an exception
}
// Do the thing that
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.