* @copyright Meritoo */ class DisabledMethodException extends Exception { /** * Creates exception * * @param string $disabledMethod Name of the disabled method * @param string $alternativeMethod (optional) Name of the alternative method * @return DisabledMethodException */ public static function create($disabledMethod, $alternativeMethod = '') { $template = 'Method %s() cannot be called, because is disabled.'; if (!empty($alternativeMethod)) { $template .= ' Use %s() instead.'; } $message = sprintf($template, $disabledMethod, $alternativeMethod); return new static($message); } }