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

fix: mapPrivatePropertiesAndMethod should not be mandatory #9

Merged
merged 2 commits into from
Oct 23, 2023

Conversation

nikophil
Copy link
Collaborator

@nikophil nikophil commented Oct 13, 2023

mapPrivatePropertiesAndMethod machanism was buggy, this is now fixed

@nikophil nikophil self-assigned this Oct 13, 2023
@nikophil nikophil marked this pull request as ready for review October 22, 2023 09:34
@@ -87,7 +87,7 @@ public function getPropertiesMapping(MapperMetadataInterface $mapperMetadata): a
$this->getMaxDepth($mapperMetadata->getSource(), $property),
$this->isIgnoredProperty($mapperMetadata->getSource(), $property),
$this->isIgnoredProperty($mapperMetadata->getTarget(), $property),
PropertyReadInfo::VISIBILITY_PUBLIC === $this->readInfoExtractor->getReadInfo($mapperMetadata->getSource(), $property)?->getVisibility() ?? true,
PropertyReadInfo::VISIBILITY_PUBLIC === ($this->readInfoExtractor->getReadInfo($mapperMetadata->getSource(), $property)?->getVisibility() ?? PropertyReadInfo::VISIBILITY_PUBLIC),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤭

this would have been detected by phpstan 😇

@@ -229,7 +229,8 @@ private function buildPropertyMapping(): void
null,
new CallbackTransformer($property),
$property,
false
false,
isPublic: true,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because we're in presence of custom mapping, I think we should consider it as public, other wise PropertyMapping::shouldIgnoreProperty() will return true

@nikophil nikophil requested a review from Korbeil October 22, 2023 09:39
Copy link
Member

@Korbeil Korbeil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, a quick note in CHANGELOG ?

CHANGELOG.md Outdated Show resolved Hide resolved
@Korbeil Korbeil merged commit e1dba93 into jolicode:main Oct 23, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants