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 <taylor@laravel.com>
This commit is contained in:
Anders Jenbo
2025-02-05 12:01:25 +01:00
committed by GitHub
parent 9edc9aad80
commit cf5aed8c2e
2 changed files with 10 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
<?php
use Illuminate\Foundation\Application;
use Illuminate\Http\Request;
define('LARAVEL_START', microtime(true));
@@ -13,5 +14,7 @@ if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php'))
require __DIR__.'/../vendor/autoload.php';
// Bootstrap Laravel and handle the request...
(require_once __DIR__.'/../bootstrap/app.php')
->handleRequest(Request::capture());
/** @var Application $app */
$app = require_once __DIR__.'/../bootstrap/app.php';
$app->handleRequest(Request::capture());