Skip to content

Commit d38197c

Browse files
some fixes
1 parent d8cd6b0 commit d38197c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Console/Commands/LaravelProjectAssist/stubs/classLikeEnumKeyAndValue.stub

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,28 @@ use HichemtabTech\LaravelProjectAssist\DataClassLikeEnumKeyAndValue;
77
class {{class}} extends DataClassLikeEnumKeyAndValue
88
{{{fields}}
99

10-
public function ALL(): array
10+
public static function ALL(): array
1111
{
1212
return [{{values}}
1313
];
1414
}
1515

16-
public function LABELS(): array
16+
public static function LABELS(): array
1717
{
1818
return array_keys($this->ALL());
1919
}
2020

21-
public function VALUES(): array
21+
public static function VALUES(): array
2222
{
2323
return array_values($this->ALL());
2424
}
2525

26-
public function getLabelByValue($value): ?string
26+
public static function getLabelByValue($value): ?string
2727
{
2828
return array_search($value, $this->ALL()) OR null;
2929
}
3030

31-
public function getValueByLabel($label): ?int
31+
public static function getValueByLabel($label): ?int
3232
{
3333
return $this->ALL()[$label]??null;
3434
}

src/Console/Commands/LaravelProjectAssist/stubs/classLikeEnumValueOnly.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class {{class}} extends DataClassLikeEnumValueOnly
88
{
99
{{fields}}
1010

11-
public function ALL(): array
11+
public static function ALL(): array
1212
{
1313
return [{{values}}
1414
];

0 commit comments

Comments
 (0)