Skip to content

Commit

Permalink
Use dynamic instead of Object for mixed type
Browse files Browse the repository at this point in the history
  • Loading branch information
kubk committed Apr 20, 2023
1 parent 7783d59 commit 77c9236
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Language/Dart/DartClassFactoryGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private function resolveFactoryProperty(
$collectionType->equalsTo(PhpBaseType::float()) => 'double',
$collectionType->equalsTo(PhpBaseType::string()) => 'String',
$collectionType->equalsTo(PhpBaseType::bool()) => 'bool',
$collectionType->equalsTo(PhpBaseType::mixed()), $collectionType->equalsTo(PhpBaseType::iterable()), $collectionType->equalsTo(PhpBaseType::array()) => 'Object',
$collectionType->equalsTo(PhpBaseType::mixed()), $collectionType->equalsTo(PhpBaseType::iterable()), $collectionType->equalsTo(PhpBaseType::array()) => 'dynamic',
$collectionType->equalsTo(PhpBaseType::null()) => 'null',
$collectionType->equalsTo(PhpBaseType::self()) => $dto->getName(),
default => throw new \Exception(sprintf("Unknown base PHP type: %s", $type->jsonSerialize()))
Expand Down
2 changes: 1 addition & 1 deletion src/Language/Dart/DartGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private function getDartTypeFromPhp(PhpTypeInterface $type, DtoType $dto, DtoLis
$type->equalsTo(PhpBaseType::float()) => 'double',
$type->equalsTo(PhpBaseType::string()) => 'String',
$type->equalsTo(PhpBaseType::bool()) => 'bool',
$type->equalsTo(PhpBaseType::mixed()), $type->equalsTo(PhpBaseType::iterable()), $type->equalsTo(PhpBaseType::array()) => 'Object',
$type->equalsTo(PhpBaseType::mixed()), $type->equalsTo(PhpBaseType::iterable()), $type->equalsTo(PhpBaseType::array()) => 'dynamic',
$type->equalsTo(PhpBaseType::null()) => 'null',
$type->equalsTo(PhpBaseType::self()) => $dto->getName(),
default => throw new \Exception(sprintf("Unknown base PHP type: %s", $type->jsonSerialize()))
Expand Down

0 comments on commit 77c9236

Please sign in to comment.