params = $params; } /** * @param array $variables [description] * * @return bool|Exception [description] */ public function checkVariables(array $variables) { if (!count($variables)) { return new Exception('No variables given, why you call me !?'); } foreach ($variables as $var) { if ('' === $this->params->get($var)) { return new Exception("Error in control $var, check env configuration !"); } } return true; } /** * @param string $variable [description] * * @return bool [description] */ public function checkIsEnabled(string $variable): bool { $result = false; $var = $this->params->get($variable); if (filter_var($var, FILTER_VALIDATE_BOOLEAN)) { $result = true; } return $result; } }