*/ class Requirement implements RequirementInterface { private $fulfilled; private $testMessage; private $helpText; private $helpHtml; private $optional; /** * Constructor that initializes the requirement. * * @param Boolean $fulfilled Whether the requirement is fulfilled * @param string $testMessage The message for testing the requirement * @param string $helpHtml The help text formatted in HTML for resolving the problem * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) * @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement */ public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false) { $this->fulfilled = (Boolean) $fulfilled; $this->testMessage = (string) $testMessage; $this->helpHtml = (string) $helpHtml; $this->helpText = null === $helpText ? strip_tags($this->helpHtml) : (string) $helpText; $this->optional = (Boolean) $optional; } /** * {@inheritdoc} */ public function isFulfilled() { return $this->fulfilled; } /** * {@inheritdoc} */ public function getTestMessage() { return $this->testMessage; } /** * {@inheritdoc} */ public function getHelpText() { return $this->helpText; } /** * {@inheritdoc} */ public function getHelpHtml() { return $this->helpHtml; } /** * {@inheritdoc} */ public function isOptional() { return $this->optional; } }