1. Go to this page and download the library: Download xakepehok/enum-helper 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/ */
xakepehok / enum-helper example snippets
class Status extends \XAKEPEHOK\EnumHelper\EnumHelper
{
const STATUS_PROCESSING = 'processing';
const STATUS_APPROVED = 'approved';
const STATUS_CANCELED = 'canceled';
private $status;
public function __construct($status)
{
self::guardValidValue($status);
$this->status = $status;
}
public function getStatus()
{
return $this->status;
}
public static function values() : array{
return [
self::STATUS_PROCESSING,
self::STATUS_APPROVED,
self::STATUS_CANCELED,
];
}
}