- Tested and works with PHP 8.3
- Added the
isAnyOf()
,isNoneOf()
anddoesNotEqualTo()
comparison methods - Added the following methods to the
EnumInterface
:equals()
doesNotEqualTo()
isAnyOf()
isNoneOf()
- Added the
EnumInterface
(contains most public v4 enum methods); theEnum
class implements it
- Tested and works with PHP 8.2
- Improved the details of the error message on unknown value errors
See the complete Upgrade Guide in the Documentation
- Dropped PHP 7.3 and PHP 7.4 support
- BC: Using strict comparison internally everywhere, consequences:
- types are now type sensitive,
- "2" != 2
- null != 0
- if you can do:
YourEnum::create("2")
then you can'tYourEnum::create(2)
- Added the feature to create enums that have a null value but the default is not the null one.
- Changed the internals to utilize streamlined PHP 8 features
- Changed the internal implementation to use argument and return types everywhere
- Changed the git attributes so that the test suite, docs and other helper files aren't exported in the vendor folder
- Fixed magic comparison getter/method in case there were numerical parts in the const name
- Tested and works with PHP 8.1
- Replaced Travis CI with Github Actions
- Dropped PHP 7.1 and 7.2 support
- Added PHP 8 support
- Adopted PSR-12 Coding style (internally)
- The
__default
const has been renamed to__DEFAULT
for full PSR-1 compliance. - It is possible to set fallback to default for unknown values.
- Rest of features are equivalent to v2.2.0.
- PHP 7.0 support has been dropped.
- Early PHP 7.4 support (as-is - since it hasn't been released yet).
- It is possible to set fallback to default for unknown values (Backport from 3.0)
- Tested against early version of PHP 7.4
- The
notEquals()
comparison method has been added. - Tested with PHP 7.3 (has been working with earlier versions as well)
- Minor fix: triggering the proper
E_USER_WARNING
error on unknown method call. - Documentation improved: jump to top when changing page
- Broader PHPUnit support, testing with php 7.2 as well on travis
- Magic checker properties and methods have been added
- Proper documentation has been created (extracted from readme + extended)
defaultValue()
static method has been added
reset()
method has been added
- Rewritten from scratch
- API has changed completely, with clarity as primary scope
- Minimum PHP version is 7.0
- Strict mode removed
equals()
does type check- For more details refer to UPGRADE-2.0.md
Development of v2 has been started.
- Display texts can be fetched dynamically via callback method
- Support for display texts has been added
- BC:
__toString()
casting now takes display text instead of const values. However the result is the very same in case no display text is being used, since it falls back to the const value if no display text is specified. - Changelog started (added all backwards versions beginning from 1.0.0
- Static method bugfix
- Readme updates
- Initial release based on konekt/comon v0.1.2, heavily refactored version