/** * * @return Ambigous <unknown, boolean>|Ambigous <\yii\db\static, boolean>|boolean */ private function getCurrentTemplate() { if ($this instanceof Templatable) { $class = get_called_class(); switch ($class::TEMPLATE_TYPE) { case $class::TEMPLATE_GRID: return FlexgridTemplate::getCurrentFor($this->template_name); break; case $class::TEMPLATE_FORM: return FlexformTemplate::getCurrentFor($this->template_name); break; } return false; } else { throw InvalidCallException('Class that uses TemplateTrait have to implement TemplatableInterface'); } }