* @copyright Meritoo */ class ClassWithoutConstructorException extends Exception { /** * Creates exception * * @param string $className Fully-qualified name of class that hasn't constructor * @return ClassWithoutConstructorException */ public static function create(string $className): ClassWithoutConstructorException { $template = 'Oops, class \'%s\' hasn\'t constructor. Did you use proper class?'; $message = sprintf($template, $className); return new static($message); } }