Skip to content

Commit

Permalink
[8.x] Flush Statics Improvements (#201)
Browse files Browse the repository at this point in the history
* Flush Statics Improvements

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

---------

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Mar 21, 2024
1 parent 4950c24 commit 88287ad
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
namespace Orchestra\Testbench\Foundation;

use Illuminate\Console\Application as Artisan;
use Illuminate\Console\Scheduling\ScheduleListCommand;
use Illuminate\Console\Signals;
use Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables;
use Illuminate\Foundation\Console\AboutCommand;
use Illuminate\Foundation\Console\ChannelListCommand;
use Illuminate\Foundation\Console\RouteListCommand;
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
use Illuminate\Foundation\Http\Middleware\TrimStrings;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Queue\Queue;
use Illuminate\Support\Arr;
use Illuminate\Support\Sleep;
Expand Down Expand Up @@ -174,15 +179,20 @@ public static function createFromConfig(ConfigContract $config, ?callable $resol
*/
public static function flushState(): void
{
AboutCommand::flushState();
Artisan::forgetBootstrappers();
ChannelListCommand::resolveTerminalWidthUsing(null);
Component::flushCache();
Component::forgetComponentsResolver();
Component::forgetFactory();
ConvertEmptyStringsToNull::flushState();
HandleExceptions::forgetApp();
JsonResource::wrap('data');
Queue::createPayloadUsing(null);
RouteListCommand::resolveTerminalWidthUsing(null);
ScheduleListCommand::resolveTerminalWidthUsing(null);
Signals::resolveAvailabilityUsing(null);
Sleep::fake(false);
AboutCommand::flushState();
TrimStrings::flushState();
}

Expand Down

0 comments on commit 88287ad

Please sign in to comment.