Reading the repo
Opening the box…
Reading the repo
Opening the box…
Assembly instructions
Enums made simple in PHP
GitHub didn't answer, so this is the saved copy from 1 days ago
Will it work on macOS?
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.
Needs Git: xcode-select --install
git clone https://github.com/brysem/phpenums.git cd phpenums
PHP >=5.3.0
brew install php composer
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',
];
}
}
On macOS: 0 got it running, 1 got stuck.
GitManual AI Agent reads the 2 key files and writes a step-by-step guide for macOS. Once written, it's saved for everyone.