diff --git a/Application.php b/Application.php index 6834db3..60cfd9b 100644 --- a/Application.php +++ b/Application.php @@ -68,7 +68,7 @@ final class Application extends Container { use InvokerAware; - public const APP_VERSION = '2.1.0'; + public const APP_VERSION = '2.1.1'; public const MIN_PHP_VERSION = '8.2'; @@ -869,6 +869,7 @@ public function isDevelopment(): bool public static function getInstance(?string $path = null): self { $basePath = match (true) { + self::$ROOT_PATH !== '' => self::$ROOT_PATH, is_string($path) && $path !== '' => $path, default => self::inferBasePath(), }; diff --git a/Helpers/core.php b/Helpers/core.php index 8d558f2..ace6fbd 100644 --- a/Helpers/core.php +++ b/Helpers/core.php @@ -38,20 +38,15 @@ * @param string|null $name * @param array $args * @return mixed - * @throws TypeException */ function app(?string $name = null, array $args = []): mixed { - $app = Application::getInstance(); - - if (is_null__($app)) { - $app = get_fresh_bootstrap(); - } + /** @var Application $app */ + $app = get_fresh_bootstrap(); if (is_null__(var: $name)) { return $app->getContainer(); } - return $app->getContainer()->make($name, $args); }