getMessage()); } } try { $app = require_once __DIR__ . '/../../bootstrap/app.php'; } catch (\Throwable $e) { LaravelVsCode::startupError($e); exit(1); } $app->register(new class($app) extends \Illuminate\Support\ServiceProvider { public function boot() { config([ 'logging.channels.null' => [ 'driver' => 'monolog', 'handler' => \Monolog\Handler\NullHandler::class, ], 'logging.default' => 'null', ]); } }); try { $kernel = $app->make(Illuminate\Contracts\Console\Kernel::class); $kernel->bootstrap(); } catch (\Throwable $e) { LaravelVsCode::startupError($e); exit(1); } echo LaravelVsCode::outputMarker('START_OUTPUT'); echo collect(app()->getBindings()) ->filter(fn ($binding) => ($binding['concrete'] ?? null) !== null) ->flatMap(function ($binding, $key) { $boundTo = new ReflectionFunction($binding['concrete']); $closureClass = $boundTo->getClosureScopeClass(); if ($closureClass === null) { return []; } return [ $key => [ 'path' => LaravelVsCode::relativePath($closureClass->getFileName()), 'class' => $closureClass->getName(), 'line' => $boundTo->getStartLine(), ], ]; })->toJson(); echo LaravelVsCode::outputMarker('END_OUTPUT'); exit(0);