1. Go to this page and download the library: Download forrest79/type-validator 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/ */
forrest79 / type-validator example snippets
assert(is_int($data)); // if we know, there will be always an int
if (!is_int($data)) throw new InvalidDataException(); // if we want to check this also in runtime
namespace App;
use App\Presenter; // this use is marked as unused
assert($presenter, 'class-string<Presenter>'); // even though it is correctly used here