PHP code example of umirode / type
1. Go to this page and download the library: Download umirode/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/ */
umirode / type example snippets
declare(strict_types=1);
use Umirode\Type\Type;
/**
* Class ExampleType
* @package Umirode\Type
*
* @method bool isActive()
* @method bool isAccepted()
* @method bool isCanceledByCustomer()
* @method static ExampleType active()
* @method static ExampleType accepted()
* @method static ExampleType canceledByCustomer()
*/
final class ExampleType extends Type
{
public const TYPES = [
'active' => 'Active',
'accepted' => 'Accepted by admin',
'canceled_by_customer' => 'Canceled by customer'
];
}
$exampleType = new ExampleType('canceled_by_customer');
$exampleType = ExampleType::canceledByCustomer();
echo $exampleType->getValue(); // Canceled by customer