@@ -59,12 +59,40 @@ public function getRule(string $fieldName): array {
59
59
public function getHelperText (string $ fieldName ): ?string {
60
60
return match ($ fieldName ) {
61
61
'CN ' => $ this ->l10n ->t ('Common Name (CN) ' ),
62
- 'C ' => $ this ->l10n ->t ('Two-letter ISO 3166 country code ' ),
62
+ 'C ' => $ tcertificate /his ->l10n ->t ('Two-letter ISO 3166 country code ' ),
63
63
'ST ' => $ this ->l10n ->t ('Full name of states or provinces ' ),
64
64
'L ' => $ this ->l10n ->t ('Name of a locality or place, such as a city, county, or other geographic region ' ),
65
65
'O ' => $ this ->l10n ->t ('Name of an organization ' ),
66
66
'OU ' => $ this ->l10n ->t ('Name of an organizational unit ' ),
67
67
default => null ,
68
68
};
69
69
}
70
+
71
+ public function getAllRules (): array {
72
+ $ result = [];
73
+ foreach ($ this ->rules as $ field => $ rule ) {
74
+ $ result [] = [
75
+ 'id ' => $ field ,
76
+ 'label ' => $ this ->getLabel ($ field ),
77
+ 'min ' => $ rule ['min ' ] ?? null ,
78
+ 'max ' => $ rule ['max ' ] ?? null ,
79
+ 'required ' => $ rule ['required ' ] ?? false ,
80
+ 'helperText ' => $ this ->getHelperText ($ field ),
81
+ ];
82
+ }
83
+ return $ result ;
84
+ }
85
+
86
+ private function getLabel (string $ fieldName ): string {
87
+ return match ($ fieldName ) {
88
+ 'CN ' => $ this ->l10n ->t ('Common Name (CN) ' ),
89
+ 'C ' => $ this ->l10n ->t ('Country ' ),
90
+ 'ST ' => $ this ->l10n ->t ('State ' ),
91
+ 'L ' => $ this ->l10n ->t ('Locality ' ),
92
+ 'O ' => $ this ->l10n ->t ('Organization ' ),
93
+ 'OU ' => $ this ->l10n ->t ('Organizational Unit ' ),
94
+ default => $ fieldName ,
95
+ };
96
+ }
97
+
70
98
}
0 commit comments