Feat: Upgrading Lunar to 1.5
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
|
||||
namespace Modules\Core\Option;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use Exception;
|
||||
use RuntimeException;
|
||||
use Traversable;
|
||||
|
||||
/**
|
||||
@@ -39,7 +42,7 @@ final class LazyOption extends Option
|
||||
public function __construct($callback, array $arguments = [])
|
||||
{
|
||||
if (!is_callable($callback)) {
|
||||
throw new \InvalidArgumentException("Invalid callback given");
|
||||
throw new InvalidArgumentException("Invalid callback given");
|
||||
}
|
||||
|
||||
$this->callback = $callback;
|
||||
@@ -71,7 +74,7 @@ final class LazyOption extends Option
|
||||
return $this->option()->getOrCall($callable);
|
||||
}
|
||||
|
||||
public function getOrThrow(\Exception $ex)
|
||||
public function getOrThrow(Exception $ex)
|
||||
{
|
||||
return $this->option()->getOrThrow($ex);
|
||||
}
|
||||
@@ -146,7 +149,7 @@ final class LazyOption extends Option
|
||||
if ($option instanceof Option) {
|
||||
$this->option = $option;
|
||||
} else {
|
||||
throw new \RuntimeException(
|
||||
throw new RuntimeException(
|
||||
sprintf("Expected instance of %s", Option::class),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user