Merged
Conversation
Contributor
OskarStark
commented
Mar 24, 2025
| Q | A |
|---|---|
| Branch? | 7.3 |
| Bug fix? | no |
| New feature? | no |
| Deprecations? | no |
| Issues | -- |
| License | MIT |
xabbuh
reviewed
Mar 24, 2025
GromNaN
reviewed
Mar 24, 2025
xabbuh
approved these changes
Mar 24, 2025
GromNaN
reviewed
Mar 24, 2025
soyuka
approved these changes
Mar 25, 2025
alexandre-daubois
approved these changes
Mar 25, 2025
Member
alexandre-daubois
left a comment
There was a problem hiding this comment.
After Jérôme's comment
b35693e to
e2d9c52
Compare
OskarStark
commented
Mar 25, 2025
| $this->expectException(MappingException::class); | ||
| $this->expectExceptionMessage('Mapping target not found for source "class@anonymous".'); | ||
| (new ObjectMapper())->map(new class () {}); | ||
| (new ObjectMapper())->map(new class {}); |
Contributor
Author
There was a problem hiding this comment.
OskarStark
commented
Mar 25, 2025
| $this->expectExceptionMessage('Cannot map "stdClass" to a non-object target of type "string".'); | ||
|
|
||
| $u = new \stdClass; | ||
| $u = new \stdClass(); |
Contributor
Author
There was a problem hiding this comment.
OskarStark
commented
Mar 25, 2025
| { | ||
| $this->expectException(MappingException::class); | ||
| $this->expectExceptionMessage(sprintf('Expected the mapped object to be an instance of "%s" but got "stdClass".', ClassWithoutTarget::class)); | ||
| $this->expectExceptionMessage(\sprintf('Expected the mapped object to be an instance of "%s" but got "stdClass".', ClassWithoutTarget::class)); |
Contributor
Author
There was a problem hiding this comment.
There should also be a CS fixer for this
Contributor
Author
There was a problem hiding this comment.
Thanks, didn't found it on the go
Contributor
Author
|
cc @nicolas-grekas and @fabpot regarding the CS settings |
Member
|
Thank you @OskarStark. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.