Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Util/ClassSourceManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function addEntityField(ClassProperty $mapping): void
}

$propertyType = $typeHint;
if ($propertyType && !$defaultValue && $propertyType !== 'mixed') {
if ($propertyType && !$defaultValue && 'mixed' !== $propertyType) {
// all property types
$propertyType = '?'.$propertyType;
}
Expand All @@ -162,13 +162,13 @@ public function addEntityField(ClassProperty $mapping): void
// getter methods always have nullable return values
// because even though these are required in the db, they may not be set yet
// unless there is a default value
null === $defaultValue && $propertyType !== 'mixed',
null === $defaultValue && 'mixed' !== $propertyType,
$commentLines
);

// don't generate setters for id fields
if (!($mapping->id ?? false)) {
$this->addSetter($mapping->propertyName, $typeHint, $nullable && $propertyType !== 'mixed');
$this->addSetter($mapping->propertyName, $typeHint, $nullable && 'mixed' !== $propertyType);
}
}

Expand Down
Loading