mirror of
https://github.com/laravel/laravel.git
synced 2025-02-20 11:53:14 +08:00
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:
parent
9edc9aad80
commit
cf5aed8c2e
7
artisan
7
artisan
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Application;
|
||||||
use Symfony\Component\Console\Input\ArgvInput;
|
use Symfony\Component\Console\Input\ArgvInput;
|
||||||
|
|
||||||
define('LARAVEL_START', microtime(true));
|
define('LARAVEL_START', microtime(true));
|
||||||
@ -9,7 +10,9 @@ define('LARAVEL_START', microtime(true));
|
|||||||
require __DIR__.'/vendor/autoload.php';
|
require __DIR__.'/vendor/autoload.php';
|
||||||
|
|
||||||
// Bootstrap Laravel and handle the command...
|
// Bootstrap Laravel and handle the command...
|
||||||
$status = (require_once __DIR__.'/bootstrap/app.php')
|
/** @var Application $app */
|
||||||
->handleCommand(new ArgvInput);
|
$app = require_once __DIR__.'/bootstrap/app.php';
|
||||||
|
|
||||||
|
$status = $app->handleCommand(new ArgvInput);
|
||||||
|
|
||||||
exit($status);
|
exit($status);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
define('LARAVEL_START', microtime(true));
|
define('LARAVEL_START', microtime(true));
|
||||||
@ -13,5 +14,7 @@ if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php'))
|
|||||||
require __DIR__.'/../vendor/autoload.php';
|
require __DIR__.'/../vendor/autoload.php';
|
||||||
|
|
||||||
// Bootstrap Laravel and handle the request...
|
// Bootstrap Laravel and handle the request...
|
||||||
(require_once __DIR__.'/../bootstrap/app.php')
|
/** @var Application $app */
|
||||||
->handleRequest(Request::capture());
|
$app = require_once __DIR__.'/../bootstrap/app.php';
|
||||||
|
|
||||||
|
$app->handleRequest(Request::capture());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user