PHP code example of thorough-php / type-signature

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

    

thorough-php / type-signature example snippets


TypeSignature::array('string'); // => 'string[]'

TypeSignature::number(); // => 'integer|float|double'

TypeSignature::union(TypeSignature::integer(), TypeSignature::string()); // => 'integer|string'

TypeSignature::intersection(\ArrayAccess::class, \Countable::class); // => 'ArrayAccess&Countable'

TypeSignature::optional(TypeSignature::string()); => 'string