Reading the repo
Opening the box…
Reading the repo
Opening the box…
How to install on Windows
Enums made simple in PHP
GitHub didn't answer, so this is the saved copy from 1 days ago
Will it work on Windows?
Then run powershell -ExecutionPolicy Bypass -File .\setup.ps1. 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: winget install Git.Git
git clone https://github.com/brysem/phpenums.git cd phpenums
PHP >=5.3.0
scoop install php composer # needs scoop: https://scoop.sh
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 Windows yet.
GitManual AI Agent reads the 2 key files and writes a step-by-step guide for Windows. Once written, it's saved for everyone.