PHP code example of demoniacdeath / enum-bundle

1. Go to this page and download the library: Download demoniacdeath/enum-bundle 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/ */

    

demoniacdeath / enum-bundle example snippets




namespace App\Enum;

use MyCLabs\Enum\Enum;

class Status extends Enum {
    public const SUCCESS = 1;
    public const ERROR = 2;
    
    public static function castValueIn($value) {
        return (int) $value;
    }
}