@@ -33,7 +33,8 @@ abstract class SimpleDTO implements BaseDTO, CastsAttributes
3333{
3434 use DataResolver, DataTransformer;
3535
36- protected array $ data = [];
36+ /** @internal */
37+ protected array $ dtoData = [];
3738
3839 protected array $ validatedData = [];
3940
@@ -63,7 +64,7 @@ public function __construct(?array $data = null)
6364 }
6465
6566 $ this ->buildAttributesData ();
66- $ this ->data = $ this ->buildDataForValidation ($ data );
67+ $ this ->dtoData = $ this ->buildDataForValidation ($ data );
6768
6869 $ this ->initConfig ();
6970
@@ -193,7 +194,7 @@ protected function passedValidation(): void
193194 }
194195 }
195196
196- $ this ->data = [];
197+ $ this ->dtoData = [];
197198 }
198199
199200 protected function failedValidation (): void
@@ -219,7 +220,7 @@ protected function validatedData(): array
219220 /** @var array<Castable> $casts */
220221 $ casts = $ this ->buildCasts ();
221222
222- foreach ($ this ->data as $ key => $ value ) {
223+ foreach ($ this ->dtoData as $ key => $ value ) {
223224 if (in_array ($ key , $ acceptedKeys )) {
224225 if (! array_key_exists ($ key , $ casts )) {
225226 if ($ this ->requireCasting ) {
@@ -514,7 +515,7 @@ private function getAcceptedProperties(): array
514515 private function isforbiddenProperty (string $ property ): bool
515516 {
516517 return in_array ($ property , [
517- 'data ' ,
518+ 'dtoData ' ,
518519 'validatedData ' ,
519520 'requireCasting ' ,
520521 'validator ' ,
0 commit comments