PHP code example of soyhuce / phpstan-extension

1. Go to this page and download the library: Download soyhuce/phpstan-extension library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

soyhuce / phpstan-extension example snippets




$datetime->copy()->addDay(); // ko
$datetime->addDay(); // ok



use Auth; // ko
use Illuminate\Support\Facades\Auth; // ok



\Illuminate\Support\Carbon::create($year, $month, $day); // ko
\Illuminate\Support\Facade\Date::create($year, $month, $day); // ok
\Carbon\CarbonImmutable::create($year, $month, $day); // ok



use Illuminate\Support\Carbon; // ko
use Carbon\Carbon; // ko
use Carbon\CarbonInterface; // ok
use Carbon\ImmutableCarbon; // ok



$dateTime = new Illuminate\Support\Carbon($date); // ko
$dateTime = new Carbon\Carbon($date); // ko
$dateTime = new Carbon\ImmutableCarbon($date); // ok

use Carbon\FactoryImmutable;
use Illuminate\Support\Facades\Date;

Date::use(FactoryImmutable::class);
$request->date('published_at'); // CarbonImmutable|null