diff --git a/composer.json b/composer.json index 2a7819b..4359242 100644 --- a/composer.json +++ b/composer.json @@ -26,8 +26,8 @@ "require": { "php": "^8", "composer/class-map-generator": "^1", - "illuminate/contracts": "^9 || ^10 || ^11", - "illuminate/support": "^9 || ^10 || ^11", + "illuminate/contracts": "^9 || ^10 || ^11 || ^12", + "illuminate/support": "^9 || ^10 || ^11 || ^12", "laminas/laminas-code": "^3.4 || ^4", "nikic/php-parser": "^4.13.2 || ^5" }, diff --git a/src/Enum.php b/src/Enum.php index 6f1c996..832180f 100644 --- a/src/Enum.php +++ b/src/Enum.php @@ -13,9 +13,10 @@ use Illuminate\Support\Facades\Lang; use Illuminate\Support\Str; use Illuminate\Support\Traits\Macroable; +use TijsVerkoyen\CssToInlineStyles\Css\Rule\Rule; /** - * @template TValue + * @template-covariant TValue * * @implements Arrayable */ @@ -77,7 +78,10 @@ public static function __set_state(array $enum): static /** * Make a new instance from an enum value. * - * @param TValue $enumValue + * @param TValue $enumValue + * + * @return static + * @throws InvalidEnumMemberException */ public static function fromValue(mixed $enumValue): static { @@ -103,7 +107,10 @@ protected static function getReflection(): \ReflectionClass /** * Make an enum instance from a given key. * - * @throws \BenSampo\Enum\Exceptions\InvalidEnumKeyException + * @param string $key + * @return static + * @throws InvalidEnumKeyException + * @throws InvalidEnumMemberException */ public static function fromKey(string $key): static { @@ -213,7 +220,12 @@ public static function getInstances(): array ); } - /** Attempt to instantiate a new Enum using the given key or value. */ + /** Attempt to instantiate a new Enum using the given key or value. + * @param mixed $enumKeyOrValue + * + * @return static|null + * @throws InvalidEnumMemberException + */ public static function coerce(mixed $enumKeyOrValue): ?static { if ($enumKeyOrValue === null) { @@ -221,6 +233,7 @@ public static function coerce(mixed $enumKeyOrValue): ?static } if ($enumKeyOrValue instanceof static) { + /** @var static */ return $enumKeyOrValue; }