Skip to content

Commit 2bb058e

Browse files
authored
Merge pull request #623 from joanhey/patch-1
Simplify Flight and faster performance
2 parents db84fb6 + 78e3a5e commit 2bb058e

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

flight/Flight.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ class Flight
8787
/** Framework engine. */
8888
private static Engine $engine;
8989

90-
/** Whether or not the app has been initialized. */
91-
private static bool $initialized = false;
92-
9390
/**
9491
* Don't allow object instantiation
9592
*
@@ -127,14 +124,7 @@ public static function __callStatic(string $name, array $params)
127124
/** @return Engine Application instance */
128125
public static function app(): Engine
129126
{
130-
if (!self::$initialized) {
131-
require_once __DIR__ . '/autoload.php';
132-
133-
self::setEngine(new Engine());
134-
self::$initialized = true;
135-
}
136-
137-
return self::$engine;
127+
return self::$engine ?? self::$engine = new Engine();
138128
}
139129

140130
/**

0 commit comments

Comments
 (0)