Skip to content

Commit ce2673d

Browse files
authored
Update string.rst
1 parent 913fd3b commit ce2673d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/source/types/string.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ You can implement custom format validators and use them in your schema files. Yo
159159
160160
$generator = new Generator(
161161
(new GeneratorConfiguration())
162-
->addFormat(new MyCustomFormat())
162+
->addFormat('customFormat', new MyCustomFormat())
163163
);
164164
165165
Your format validator must implement the interface **PHPModelGenerator\\Format\\FormatValidatorInterface**.
@@ -170,7 +170,7 @@ If your custom format is representable by a regular expression you can bypass im
170170
171171
$generator = new Generator(
172172
(new GeneratorConfiguration())
173-
->addFormat(new FormatValidatorFromRegEx('/^\d*$/'))
173+
->addFormat('numeric', new FormatValidatorFromRegEx('/^\d*$/'))
174174
);
175175
176176
.. hint::

0 commit comments

Comments
 (0)