1. Go to this page and download the library: Download compono-kit/types 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/ */
compono-kit / types example snippets
class MyString {
use RepresentingString;
}
$str = new MyString("Hello World");
echo $str->toUpperCase(); // "HELLO WORLD"
abstract class AbstractEmail extends AbstractString {
public static function isValid(string $value): bool {
return filter_var($value, FILTER_VALIDATE_EMAIL) !== false;
}
}
$string = new StringType("Hello World");
echo $string->toUpperCase(); // "HELLO WORLD"