Feat: Upgrading Lunar to 1.5

This commit is contained in:
2026-08-31 13:16:13 +03:00
parent 661e8b9a96
commit d873cb4931
42 changed files with 229 additions and 173 deletions
+6 -3
View File
@@ -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),
);
}