You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-7Lines changed: 17 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,9 @@ By default `dto-converter` writes all the types into one file. You can configure
76
76
77
77
$application->add(
78
78
newConvertCommand(
79
-
newConverter(newPhpAttributeFilter('Dto')),
79
+
newConverter([
80
+
newDtoVisitor(newPhpAttributeFilter('Dto')),
81
+
]),
80
82
newTypeScriptGenerator(
81
83
-newSingleFileOutputWriter('generated.ts'),
82
84
+newEntityPerClassOutputWriter(
@@ -106,8 +108,10 @@ Suppose you don't want to mark each DTO individually with `#[Dto]` but want to c
106
108
```diff
107
109
$application->add(
108
110
new ConvertCommand(
109
-
- new Converter(new PhpAttributeFilter('Dto')),
110
-
+ new Converter(),
111
+
- new Converter([
112
+
- new DtoVisitor(new PhpAttributeFilter('Dto')),
113
+
- ]),
114
+
+ new Converter([new DtoVisitor()]),
111
115
new TypeScriptGenerator(
112
116
new SingleFileOutputWriter('generated.ts'),
113
117
[
@@ -133,7 +137,9 @@ You can even go further and use `NegationFilter` to exclude specific files as sh
133
137
134
138
$application->add(
135
139
new ConvertCommand(
136
-
new Converter(new PhpAttributeFilter('Dto')),
140
+
new Converter([
141
+
new DtoVisitor(new PhpAttributeFilter('Dto')),
142
+
]),
137
143
new TypeScriptGenerator(
138
144
new SingleFileOutputWriter('generated.ts'),
139
145
[
@@ -160,12 +166,14 @@ $application->add(
160
166
161
167
### How to customize generated output file?
162
168
163
-
You may want to apply some transformations on the resulted file with types. For example you may want to format it with tool of your choice or prepend code with a warning like "// The file was autogenerated, don't edit it manually". To add such a warning you can already use the built-in extension:
169
+
You may want to apply some transformations on the resulted file with types. For example, you may want to format it with tool of your choice or prepend code with a warning like "// The file was autogenerated, don't edit it manually". To add such a warning you can already use the built-in extension:
0 commit comments