Repository navigation
Releases
Releases · Pharaonic/php-smart-enum
v8.5.1
Changed
- Documentation puts the
is<Case>()checks first, with a case-name-to-check table (IN_PROGRESS→isInProgress()), the names that are not checks and what to write instead, and a status-branching example.
Full Changelog: 8.5.0...8.5.1
v8.5.0
Added
SmartEnumtrait for native enums.- Static helpers:
names(),labels(),values(),options(),fromName(),tryFromName(),hasName(),hasValue(). - Instance helpers:
label(),eq(),is(),isNot(),in(),notIn(),info(). is<Case>()checks for every case, resolved by__call(); a check shared by two cases throwsBadMethodCallException.- Optional global
smart_enum_label()hook for labels. - Unit enum support:
values(),options(),hasValue(),info()andis()use the case name as its value. - Tests, PHPStan (level max), PHP_CodeSniffer (PSR-12) and CI configuration.
- Repository documentation and contribution files.
- Versioned documentation in
docs/for pharaonic.dev.
Compatibility
- Requires PHP
>=8.5 <8.6.
v8.4.0
Added
SmartEnumtrait for native enums.- Static helpers:
names(),labels(),values(),options(),fromName(),tryFromName(),hasName(),hasValue(). - Instance helpers:
label(),eq(),is(),isNot(),in(),notIn(),info(). is<Case>()checks for every case, resolved by__call(); a check shared by two cases throwsBadMethodCallException.- Optional global
smart_enum_label()hook for labels. - Unit enum support:
values(),options(),hasValue(),info()andis()use the case name as its value. - Tests, PHPStan (level max), PHP_CodeSniffer (PSR-12) and CI configuration.
- Repository documentation and contribution files.
- Versioned documentation in
docs/for pharaonic.dev.
Compatibility
- Requires PHP
>=8.4 <8.5.
v8.3.0
Added
SmartEnumtrait for native enums.- Static helpers:
names(),labels(),values(),options(),fromName(),tryFromName(),hasName(),hasValue(). - Instance helpers:
label(),eq(),is(),isNot(),in(),notIn(),info(). is<Case>()checks for every case, resolved by__call(); a check shared by two cases throwsBadMethodCallException.- Optional global
smart_enum_label()hook for labels. - Unit enum support:
values(),options(),hasValue(),info()andis()use the case name as its value. - Tests, PHPStan (level max), PHP_CodeSniffer (PSR-12) and CI configuration.
- Repository documentation and contribution files.
- Versioned documentation in
docs/for pharaonic.dev.
Compatibility
- Requires PHP
>=8.3 <8.4.
v8.2.0
Added
SmartEnumtrait for native enums.- Static helpers:
names(),labels(),values(),options(),fromName(),tryFromName(),hasName(),hasValue(). - Instance helpers:
label(),eq(),is(),isNot(),in(),notIn(),info(). is<Case>()checks for every case, resolved by__call(); a check shared by two cases throwsBadMethodCallException.- Optional global
smart_enum_label()hook for labels. - Unit enum support:
values(),options(),hasValue(),info()andis()use the case name as its value. - Tests, PHPStan (level max), PHP_CodeSniffer (PSR-12) and CI configuration.
- Repository documentation and contribution files.
- Versioned documentation in
docs/for pharaonic.dev.
Compatibility
- Requires PHP
>=8.2 <8.3.
v8.1.1
Changed
- The package archive no longer includes
docs/, socomposer requireinstalls only the library files.
Full Changelog: 8.1.0...8.1.1
v8.1.0
Added
SmartEnumtrait for native enums.- Static helpers:
names(),labels(),values(),options(),fromName(),tryFromName(),hasName(),hasValue(). - Instance helpers:
label(),eq(),is(),isNot(),in(),notIn(),info(). is<Case>()checks for every case, resolved by__call(); a check shared by two cases throwsBadMethodCallException.- Optional global
smart_enum_label()hook for labels. - Unit enum support:
values(),options(),hasValue(),info()andis()use the case name as its value. - Tests, PHPStan (level max), PHP_CodeSniffer (PSR-12) and CI configuration.
- Repository documentation and contribution files.
- Versioned documentation in
docs/for pharaonic.dev.
Compatibility
- Requires PHP
>=8.1 <8.2.