+3
-3
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "tez/utils-enum",
|
"name": "tezmanian/utils-enum",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"description": " A collection of PHP traits that supercharge native enums with comparison, bit-flag, stepping, collection, and translation helpers — zero dependencies, PHP 8.3+.",
|
"description": " A collection of PHP traits that supercharge native enums with comparison, bit-flag, stepping, collection, and translation helpers — zero dependencies, PHP 8.3+.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@@ -20,12 +20,12 @@
|
|||||||
],
|
],
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Tez\\Utils\\Enum\\": "src/"
|
"Tezmanian\\Utils\\Enum\\": "src/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload-dev": {
|
"autoload-dev": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Tez\\Utils\\Tests\\Enum\\": "tests/"
|
"Tezmanian\\Utils\\Tests\\Enum\\": "tests/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Tez\Utils\Enum;
|
namespace Tezmanian\Utils\Enum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extends EnumTrait for string- and int-backed enums.
|
* Extends EnumTrait for string- and int-backed enums.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Tez\Utils\Enum;
|
namespace Tezmanian\Utils\Enum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bitmask helpers for int-backed enums used as flag sets.
|
* Bitmask helpers for int-backed enums used as flag sets.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Tez\Utils\Enum;
|
namespace Tezmanian\Utils\Enum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Comparison helpers for int-backed enums.
|
* Comparison helpers for int-backed enums.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Tez\Utils\Enum;
|
namespace Tezmanian\Utils\Enum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add-on trait providing collection-style selection helpers for any enum.
|
* Add-on trait providing collection-style selection helpers for any enum.
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Tez\Utils\Enum;
|
namespace Tezmanian\Utils\Enum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base trait for pure (unit) enums.
|
* Base trait for pure (unit) enums.
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Tez\Utils\Enum;
|
namespace Tezmanian\Utils\Enum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Navigation helpers for stepping to the adjacent case by definition order.
|
* Navigation helpers for stepping to the adjacent case by definition order.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Tez\Utils\Enum;
|
namespace Tezmanian\Utils\Enum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides human-readable labels for enum cases without any framework dependency.
|
* Provides human-readable labels for enum cases without any framework dependency.
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Tez\Utils\Tests\Enum;
|
namespace Tezmanian\Utils\Tests\Enum;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Tez\Utils\Enum\BackedEnumTrait;
|
use Tezmanian\Utils\Enum\BackedEnumTrait;
|
||||||
|
|
||||||
// String-backed enum
|
// String-backed enum
|
||||||
enum Color: string
|
enum Color: string
|
||||||
@@ -167,7 +167,7 @@ final class BackedEnumTraitTest extends TestCase
|
|||||||
self::assertSame(
|
self::assertSame(
|
||||||
['Red' => 'red', 'Green' => 'green', 'Blue' => 'blue'],
|
['Red' => 'red', 'Green' => 'green', 'Blue' => 'blue'],
|
||||||
Color::toValueArray(),
|
Color::toValueArray(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testToValueArrayForIntBackedEnum(): void
|
public function testToValueArrayForIntBackedEnum(): void
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Tez\Utils\Tests\Enum;
|
namespace Tezmanian\Utils\Tests\Enum;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Tez\Utils\Enum\BackedEnumTrait;
|
use Tezmanian\Utils\Enum\BackedEnumTrait;
|
||||||
use Tez\Utils\Enum\BitFlagTrait;
|
use Tezmanian\Utils\Enum\BitFlagTrait;
|
||||||
|
|
||||||
enum Permission: int
|
enum Permission: int
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Tez\Utils\Tests\Enum;
|
namespace Tezmanian\Utils\Tests\Enum;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Tez\Utils\Enum\BackedEnumTrait;
|
use Tezmanian\Utils\Enum\BackedEnumTrait;
|
||||||
use Tez\Utils\Enum\ComparableTrait;
|
use Tezmanian\Utils\Enum\ComparableTrait;
|
||||||
|
|
||||||
enum Level: int
|
enum Level: int
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Tez\Utils\Tests\Enum;
|
namespace Tezmanian\Utils\Tests\Enum;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Tez\Utils\Enum\EnumCollectionTrait;
|
use Tezmanian\Utils\Enum\EnumCollectionTrait;
|
||||||
|
|
||||||
enum Suit: string
|
enum Suit: string
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Tez\Utils\Tests\Enum;
|
namespace Tezmanian\Utils\Tests\Enum;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Tez\Utils\Enum\BackedEnumTrait;
|
use Tezmanian\Utils\Enum\BackedEnumTrait;
|
||||||
use Tez\Utils\Enum\EnumTrait;
|
use Tezmanian\Utils\Enum\EnumTrait;
|
||||||
|
|
||||||
// Pure (unit) enum used across all EnumTrait tests
|
// Pure (unit) enum used across all EnumTrait tests
|
||||||
enum Season
|
enum Season
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ declare(strict_types=1);
|
|||||||
namespace Tez\Utils\Tests\Enum;
|
namespace Tez\Utils\Tests\Enum;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Tez\Utils\Enum\EnumTrait;
|
use Tezmanian\Utils\Enum\EnumTrait;
|
||||||
use Tez\Utils\Enum\StepTrait;
|
use Tezmanian\Utils\Enum\StepTrait;
|
||||||
|
|
||||||
enum OrderStatus
|
enum OrderStatus
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Tez\Utils\Tests\Enum;
|
namespace Tezmanian\Utils\Tests\Enum;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Tez\Utils\Enum\BackedEnumTrait;
|
use Tezmanian\Utils\Enum\BackedEnumTrait;
|
||||||
use Tez\Utils\Enum\TranslatableTrait;
|
use Tezmanian\Utils\Enum\TranslatableTrait;
|
||||||
|
|
||||||
enum StatusWithLabels: string
|
enum StatusWithLabels: string
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user