Reading the repo
Opening the box…
Reading the repo
Opening the box…
How to install on Linux
Enums made simple in PHP
GitHub didn't answer, so this is the saved copy from 1 days ago
Will it work on Linux?
Then run bash setup.sh. It stops at the first error and is safe to run again. Servers and tests aren't started; it lists them at the end. Read it first.
git clone https://github.com/brysem/phpenums.git cd phpenums
PHP >=5.3.0
sudo apt install php-cli php-mbstring php-xml php-curl unzip composer # Debian/Ubuntu
composer install
PHP Enums can be installed with Composer.
$ composer require brysem/phpenums
{
"require": {
"brysem/phpenums": "1.*"
}
}
<?php
require 'vendor/autoload.php';
use Bryse\Enums\Enum;
class UserStatus extends Enum
{
const PENDING = 1;
const ACTIVE = 2;
const BANNED = 3;
/**
* Returns all possible key value pairs for the enum.
*
* @return array
*/
public function values()
{
return [
self::PENDING => 'Pending',
self::ACTIVE => 'Active',
self::BANNED => 'Banned',
];
}
}
No reports for Linux yet.
GitManual AI Agent reads the 2 key files and writes a step-by-step guide for Linux. Once written, it's saved for everyone.