Dev: change the return type for the exception.

This commit is contained in:
ping-yee 2023-08-04 13:25:02 +08:00
parent 2aa4bd54cc
commit fbd6d94a50
No known key found for this signature in database
GPG Key ID: C548278C3B604B42

View File

@ -26,7 +26,7 @@ class PublisherException extends FrameworkException
* @param string $from The source file
* @param string $to The destination file
*/
public static function forCollision(string $from, string $to): PublisherException
public static function forCollision(string $from, string $to): self
{
return new static(lang('Publisher.collision', [filetype($to), $from, $to]));
}
@ -34,7 +34,7 @@ class PublisherException extends FrameworkException
/**
* Throws when given a destination that is not in the list of allowed directories.
*/
public static function forDestinationNotAllowed(string $destination): PublisherException
public static function forDestinationNotAllowed(string $destination): self
{
return new static(lang('Publisher.destinationNotAllowed', [$destination]));
}
@ -42,7 +42,7 @@ class PublisherException extends FrameworkException
/**
* Throws when a file fails to match the allowed pattern for its destination.
*/
public static function forFileNotAllowed(string $file, string $directory, string $pattern): PublisherException
public static function forFileNotAllowed(string $file, string $directory, string $pattern): self
{
return new static(lang('Publisher.fileNotAllowed', [$file, $directory, $pattern]));
}