stephenjude / enums
Custom Type Enum Constants
Fund package maintenance!
stephenjude
github.com/stephenjude
Installs: 1 752
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^7.4|^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.17
- phpunit/phpunit: ^9.5
- spatie/ray: ^1.10
- vimeo/psalm: ^4.3
This package is auto-updated.
Last update: 2022-04-25 13:20:28 UTC
README
If you have built a project where you create constants for variables like success
pending
failed
so as to have consistency across your codebase then this package is for you. This constants inludes variables for gateways like paystack
flutterwave
paypal
ETC. This package provides class variables that you can call statistically without instantiating the class. Example: Status::PAYSTACK
Status::FLUTTWAVE
Status::PAYPAL
;
PS: If you have any variable that is not here please make a PR and I will gladly merge it.
Installation
You can install the package via composer:
composer require stephenjude/enums
Usage
All the constants we have defined in this package are grouped into different class-based categories. Lets dive into it:
Status
use Stephenjude\Enums\Status; Status::PENDING; //pending Status::SUCCESS; //success Status::FAILED; //failed Status::WARNING; //warning Status::ERROR; //error Status::PUBLISHED; //published Status::UNPUBLISHED; //unpublished Status::APPROVED; //approved Status::REJECTED; //rejected Status::PROCESSING; //processing Status::COMPLETED; //completed Status::CANCELLED; //cancelled
Gateway
use Stephenjude\Enums\Gateway; Gateway::PAYPAL; //paypal Gateway::STRIPE; //stripe Gateway::BINANCE; //binance Gateway::COINBASE; //coinbase Gateway::PAYSTACK; //paystack Gateway::FLUTTERWAVE; //flutterwave Gateway::BUYPOWER_NG; //buypowerng Gateway::BANK_TRANSFER; //bank_transfer
FileType
use Stephenjude\Enums\FileType; FileType::VIDEO; //video FileType::AUDIO; //audio FileType::DOCUMENT; //document FileType::TEXT; //text FileType::PDF; //pdf
Currency
use Stephenjude\Enums\Currency; Currency::USD; //usd Currency::CAD; //cad Currency::EUR; //eur Currency::GBP; //gbp Currency::NGN; //ngn
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.