Skip to content

Commit 144597a

Browse files
committed
Fixed issue with finding base path.
Signed-off-by: Joshua Parker <[email protected]>
1 parent de61932 commit 144597a

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

Application.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ final class Application extends Container
6868
{
6969
use InvokerAware;
7070

71-
public const APP_VERSION = '2.1.0';
71+
public const APP_VERSION = '2.1.1';
7272

7373
public const MIN_PHP_VERSION = '8.2';
7474

@@ -869,6 +869,7 @@ public function isDevelopment(): bool
869869
public static function getInstance(?string $path = null): self
870870
{
871871
$basePath = match (true) {
872+
self::$ROOT_PATH !== '' => self::$ROOT_PATH,
872873
is_string($path) && $path !== '' => $path,
873874
default => self::inferBasePath(),
874875
};

Helpers/core.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,15 @@
3838
* @param string|null $name
3939
* @param array $args
4040
* @return mixed
41-
* @throws TypeException
4241
*/
4342
function app(?string $name = null, array $args = []): mixed
4443
{
45-
$app = Application::getInstance();
46-
47-
if (is_null__($app)) {
48-
$app = get_fresh_bootstrap();
49-
}
44+
/** @var Application $app */
45+
$app = get_fresh_bootstrap();
5046

5147
if (is_null__(var: $name)) {
5248
return $app->getContainer();
5349
}
54-
5550
return $app->getContainer()->make($name, $args);
5651
}
5752

0 commit comments

Comments
 (0)