Add basic FeaturesController

[MAILPOET-2008]
This commit is contained in:
Jan Jakeš
2019-05-08 10:17:35 +02:00
committed by M. Shull
parent 9f21ff1285
commit 947d53413e
2 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?php
namespace MailPoet\Features;
class FeaturesController {
// Define features below in the following form:
// const FEATURE_NAME_OF_FEATURE = 'name-of-feature';
// Define feature defaults in the array below in the following form:
// self::FEATURE_NAME_OF_FEATURE => true,
public static $defaults = [
];
/** @return bool */
function isSupported($feature) {
if (!array_key_exists($feature, self::$defaults)) {
throw new \RuntimeException("Unknown feature '$feature'");
}
return self::$defaults[$feature];
}
}