mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-13 01:51:50 +01:00
Minor refactoring
This commit is contained in:
@@ -28,13 +28,13 @@ class DisabledMethodException extends Exception
|
||||
public static function create($disabledMethod, $alternativeMethod = '')
|
||||
{
|
||||
$template = 'Method %s() cannot be called, because is disabled.';
|
||||
$message = sprintf($template, $disabledMethod);
|
||||
|
||||
if (!empty($alternativeMethod)) {
|
||||
$template .= ' Use %s() instead.';
|
||||
$template = '%s Use %s() instead.';
|
||||
$message = sprintf($template, $message, $alternativeMethod);
|
||||
}
|
||||
|
||||
$message = sprintf($template, $disabledMethod, $alternativeMethod);
|
||||
|
||||
return new static($message);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user