{"id":36994112,"url":"https://github.com/manchenkoff/php-enum","last_synced_at":"2026-01-13T23:46:19.650Z","repository":{"id":62523257,"uuid":"266640902","full_name":"manchenkoff/php-enum","owner":"manchenkoff","description":"Enumeration type - PHP implementation with useful magic methods","archived":true,"fork":false,"pushed_at":"2020-10-07T22:20:53.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-01T16:11:26.599Z","etag":null,"topics":["enum","enumeration","laravel","oop","php","php-library","php7","yii2"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/manchenkov/php-enum","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/manchenkoff.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-24T23:19:02.000Z","updated_at":"2023-01-27T21:49:32.000Z","dependencies_parsed_at":"2022-11-02T14:15:25.130Z","dependency_job_id":null,"html_url":"https://github.com/manchenkoff/php-enum","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/manchenkoff/php-enum","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manchenkoff%2Fphp-enum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manchenkoff%2Fphp-enum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manchenkoff%2Fphp-enum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manchenkoff%2Fphp-enum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manchenkoff","download_url":"https://codeload.github.com/manchenkoff/php-enum/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manchenkoff%2Fphp-enum/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28405304,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["enum","enumeration","laravel","oop","php","php-library","php7","yii2"],"created_at":"2026-01-13T23:46:19.576Z","updated_at":"2026-01-13T23:46:19.630Z","avatar_url":"https://github.com/manchenkoff.png","language":"PHP","readme":"# PHP Enum\n\nBasic enumeration implementation in PHP, easy and ready to use.\n\n- *Enum*: to create simple enumeration class\n- *StrictEnum*: to create enumeration with strict variables type \n\n## Installation\n\nYou have to run following command to add a dependency to your project\n\n```bash\ncomposer require manchenkov/php-enum\n```\n\nor you can add this line to `require` section of `composer.json`\n\n```\n\"manchenkov/php-enum\": \"*\"\n```\n\n## How to use\n\nCreate a new class like `UserType.php` and paste the following code example:\n\n```php\nuse Manchenkov\\Enumeration\\Enum;\n\n/**\n * @method static UserType MANAGER()\n * @method static UserType ADMIN()\n */\nclass UserType extends Enum\n{\n    /**\n     * @title Manager role description\n     */\n    private const MANAGER = 'user_manager';\n\n    /**\n     * @title Administrator role description\n     */\n    private const ADMIN = 'user_admin';\n}\n```\n\nNow You can create a new instance of `UserType` enumeration and work with some methods:\n\n```php\n$manager = UserType::MANAGER();\n\n$manager-\u003egetName(); // MANAGER\n$manager-\u003egetValue(); // user_manager\n$manager-\u003egetTitle(); // Manager role description\n\n$manager-\u003eis(UserType::ADMIN()); // false\n$manager-\u003eeq('user_manager'); // true\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanchenkoff%2Fphp-enum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanchenkoff%2Fphp-enum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanchenkoff%2Fphp-enum/lists"}