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

Added skip unitialized values context param #200

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

Korbeil
Copy link
Member

@Korbeil Korbeil commented Oct 22, 2024

Fixes #189

@TheoD02
Copy link
Contributor

TheoD02 commented Dec 23, 2024

Hello, sorry for the late testing phase 😁

PR need a rebase to fix:

Too few arguments to function PHPStan\\PhpDocParser\\Parser\\ConstExprParser::__construct(), 0 passed in /app/vendor/jolicode/automapper/src/Extractor/GetTypeTrait.php on line 46 and exactly 1 expected

But apart of this error, everything work like a charm, thanks !

@Korbeil Korbeil force-pushed the feature/skip-uninitialized branch 5 times, most recently from 40a1153 to 954f1d7 Compare January 28, 2025 09:31
@Korbeil Korbeil force-pushed the feature/skip-uninitialized branch 2 times, most recently from 29b78ff to fb4a2cc Compare February 13, 2025 14:54
@Korbeil
Copy link
Member Author

Korbeil commented Feb 13, 2025

I rebased the PR @TheoD02.

But I'm kinda blocked with this pull request, in one of the test (see AutoMapper::testSkipNullValues) we have a class property default value to null. So even with isset we cannot detect if the property was initialized or not since it will return false because it's null 😞

Here is the issue: https://3v4l.org/BsDTZ

@TheoD02
Copy link
Contributor

TheoD02 commented Feb 13, 2025

I rebased the PR @TheoD02.

But I'm kinda blocked with this pull request, in one of the test (see AutoMapper::testSkipNullValues) we have a class property default value to null. So even with isset we cannot detect if the property was initialized or not since it will return false because it's null 😞

Here is the issue: https://3v4l.org/BsDTZ

Hello thanks for your answer, maybe we can do something like in PropertyAccessor ?

Not really checked the possibility in your implementation

https://github.com/symfony/property-access/blob/b28732e315d81fbec787f838034de7d6c9b2b902/PropertyAccessor.php#L417-L429

@Korbeil
Copy link
Member Author

Korbeil commented Feb 14, 2025

After talking with @lyrixx he gave me the same thing that PropertyAccess does use: https://3v4l.org/idiOR
I'll try using that trick.

@Korbeil Korbeil force-pushed the feature/skip-uninitialized branch 2 times, most recently from ae31055 to 97d6a64 Compare February 14, 2025 10:13
@Korbeil Korbeil marked this pull request as ready for review February 14, 2025 10:14
@Korbeil Korbeil force-pushed the feature/skip-uninitialized branch from 97d6a64 to c6831e9 Compare February 14, 2025 10:18
@Korbeil
Copy link
Member Author

Korbeil commented Feb 14, 2025

@TheoD02 the issue is now fixed, if you want to test again / review that PR !

@TheoD02
Copy link
Contributor

TheoD02 commented Feb 14, 2025

@TheoD02 the issue is now fixed, if you want to test again / review that PR !

I'll will check this evening, or tomorrow 😀

@Korbeil
Copy link
Member Author

Korbeil commented Feb 17, 2025

Any news @TheoD02 ?

@TheoD02
Copy link
Contributor

TheoD02 commented Feb 17, 2025

Any news @TheoD02 ?

Sorry, didn't have time to test it :/

Just updated and runned some tests, and no regression identified on my project, seem to be good ! 😄

@Korbeil Korbeil force-pushed the feature/skip-uninitialized branch from c6831e9 to 4c2f6a8 Compare February 18, 2025 08:58
@Korbeil Korbeil merged commit 1d0ab8a into main Feb 18, 2025
10 checks passed
@Korbeil Korbeil deleted the feature/skip-uninitialized branch February 18, 2025 08:59
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.

skip_uninitialized_values not working ?
2 participants