File tree Expand file tree Collapse file tree 2 files changed +21
-4
lines changed
Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ protected function mixed(null|string|Closure $attribute = null): ValueMixed
9292 /**
9393 * @param null|string|Closure(T):mixed $attribute
9494 *
95- * @return ValueEnum<T>
95+ * @return ValueEnum<T, mixed >
9696 */
9797 protected function enum (null |string |Closure $ attribute = null ): ValueEnum
9898 {
@@ -110,10 +110,9 @@ protected function struct(Closure $attribute): ValueStruct
110110 }
111111
112112 /**
113- * @template U
114- * @param Value<U> $type
113+ * @param Value<T> $type
115114 * @param null|string|Closure(T):(array<mixed>|null) $attribute
116- * @return ValueArray<T, U >
115+ * @return ValueArray<T, mixed >
117116 */
118117 protected function arrayOf (Value $ type , null |string |Closure $ attribute = null ): ValueArray
119118 {
Original file line number Diff line number Diff line change 88
99/**
1010 * @template T
11+ * @template U extends UnitEnum|BackedEnum
1112 * @extends Value<T>
1213 */
1314class ValueEnum extends Value
1415{
16+ /**
17+ * @var class-string<U>|null
18+ */
19+ protected null |string $ type = null ;
20+
21+ /**
22+ * Define the type of elements in the array
23+ *
24+ * @param class-string<U> $type
25+ * @return $this<T, U>
26+ */
27+ public function of (string $ type ): static
28+ {
29+ $ this ->type = $ type ;
30+ return $ this ;
31+ }
32+
1533 protected function value (mixed $ of , Request $ request ): mixed
1634 {
1735 if ($ of instanceof BackedEnum) return $ of ->value ;
You can’t perform that action at this time.
0 commit comments