PHP code example of php-standard-library / phpstan-extension

1. Go to this page and download the library: Download php-standard-library/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/ */

    

php-standard-library / phpstan-extension example snippets


use Psl\Type;

$specification = Type\shape([
    'name' => Type\string(),
    'age' => Type\int(),
    'location' => Type\optional(Type\shape([
        'city' => Type\string(),
        'state' => Type\string(),
        'country' => Type\string(),
    ]))
]);

$input = $specification->coerce($_GET['user']);


    - vendor/php-standard-library/phpstan-extension/extension.neon