1. Go to this page and download the library: Download skinka/type-enum 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/ */
skinka / type-enum example snippets
namespace skinka\php\TypeEnum\enums;
use skinka\php\TypeEnum\BaseEnum;
/**
* Class to enumerations of YES or NO status
*
* @method static YesNo YES()
* @method static YesNo NO()
* @method string text()
*/
class YesNo extends BaseEnum
{
const YES = 1;
const NO = 0;
public static function getData() {
return [
self::YES => [
'text' => 'Yes',
],
self::NO => [
'text' => 'No',
]
];
}
}