Skip to content

Commit

Permalink
Merge pull request #623 from joanhey/patch-1
Browse files Browse the repository at this point in the history
Simplify Flight and faster performance
  • Loading branch information
n0nag0n authored Feb 16, 2025
2 parents db84fb6 + 78e3a5e commit 2bb058e
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions flight/Flight.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ class Flight
/** Framework engine. */
private static Engine $engine;

/** Whether or not the app has been initialized. */
private static bool $initialized = false;

/**
* Don't allow object instantiation
*
Expand Down Expand Up @@ -127,14 +124,7 @@ public static function __callStatic(string $name, array $params)
/** @return Engine Application instance */
public static function app(): Engine
{
if (!self::$initialized) {
require_once __DIR__ . '/autoload.php';

self::setEngine(new Engine());
self::$initialized = true;
}

return self::$engine;
return self::$engine ?? self::$engine = new Engine();
}

/**
Expand Down

0 comments on commit 2bb058e

Please sign in to comment.