mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 17:41:50 +01:00
Exceptions > create instance of exception using static "create()" method (instead of constructor)
This commit is contained in:
@@ -17,10 +17,10 @@ namespace Meritoo\Common\Exception\File;
|
||||
class EmptyFilePathException extends \Exception
|
||||
{
|
||||
/**
|
||||
* Class constructor
|
||||
* Creates exception
|
||||
*/
|
||||
public function __construct()
|
||||
public static function create()
|
||||
{
|
||||
parent::__construct('Path of the file is empty. Did you provide path of proper file?');
|
||||
return new static('Path of the file is empty. Did you provide path of proper file?');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user