From cf5aed8c2e7fe9ae038e76ccd0ac8de1cdc3dded Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Wed, 5 Feb 2025 12:01:25 +0100 Subject: [PATCH] Improve static analysis by adding type hints for $app in artisan and public/index.php (#6531) * feat: add type hints for $app in artisan and public/index.php Added PHPDoc type hints for the $app variable to improve static analysis support in PHPStan and PHPStorm. This prevents tools from incorrectly flagging the variable and enhances developer experience. No functional changes; only improves code readability and IDE support. * Update artisan * Update index.php --------- Co-authored-by: Taylor Otwell --- artisan | 7 +++++-- public/index.php | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/artisan b/artisan index 8e04b4224..c35e31d6a 100755 --- a/artisan +++ b/artisan @@ -1,6 +1,7 @@ #!/usr/bin/env php handleCommand(new ArgvInput); +/** @var Application $app */ +$app = require_once __DIR__.'/bootstrap/app.php'; + +$status = $app->handleCommand(new ArgvInput); exit($status); diff --git a/public/index.php b/public/index.php index 947d98963..ee8f07e99 100644 --- a/public/index.php +++ b/public/index.php @@ -1,5 +1,6 @@ handleRequest(Request::capture()); +/** @var Application $app */ +$app = require_once __DIR__.'/../bootstrap/app.php'; + +$app->handleRequest(Request::capture());