Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor: cs fix #1623

Merged
merged 1 commit into from
Dec 10, 2024
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