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
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -126,6 +126,36 @@ $application->add(
126
126
You can even go further and use `NegationFilter` to exclude specific files as shown in [unit tests](https://github.com/riverwaysoft/dto-converter/blob/a8d5df2c03303c02bc9148bd1d7822d7fe48c5d8/tests/EndToEndTest.php#L297).
127
127
128
128
129
+
## Error list
130
+
Here is a list of errors `dto-converter` can throw and description what to do if you encounter these errors:
131
+
132
+
### 1. Property z of class X has no type. Please add PHP type
133
+
It means that you've forgotten to add type for property `a` of class Y. Example:
134
+
135
+
```php
136
+
#[Dto]
137
+
class X {
138
+
public $z;
139
+
}
140
+
```
141
+
142
+
At the moment there is no strict / loose mode in `dto-converter`. It could silently convert such types to TypeScript `any` or Dart `Object` but we don't need that feature. Feel free to raise an issue if having loose mode makes sense for you. If you don't know the PHP type just use [mixed](https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.mixed) type to explicitly convert it to `any`/`Object`.
143
+
144
+
145
+
### 2. PHP Type X is not supported
146
+
It means `dto-converter` doesn't understand how to convert the type X into TypeScript or Dart. If you are using `#[Dto]` attribute you probably forgot to add it to class `X`. Example:
0 commit comments