PHP code example of xdevor / type

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

    

xdevor / type example snippets



function increase(int $count)
{
    if ($count < 1) {
        throw new InvalidArgumentException('Receive invalid argument');
    }
    return $this->value + $count;
}


use Xdevor\Type\Numbers\PositiveInt;

function increase(PositiveInt $count)
{
    return $this->value + $count->value();
}