Normalize identifiers to the correct type#1014
Merged
soyuka merged 1 commit intoapi-platform:masterfrom Apr 8, 2017
Merged
Conversation
dunglas
requested changes
Mar 28, 2017
| $doctrineMetadataIdentifier = $manager->getClassMetadata($resourceClass)->getIdentifier(); | ||
| $doctrineClassMetadata = $manager->getClassMetadata($resourceClass); | ||
| $doctrineIdentifierFields = $doctrineClassMetadata->getIdentifier(); | ||
| $isOrm = interface_exists(EntityManagerInterface::class) && $manager instanceof EntityManagerInterface; |
Member
There was a problem hiding this comment.
The call to interface_exists is useless.
Contributor
Author
There was a problem hiding this comment.
I think PHPStan will complain:
- Existence of classes and interfaces in
instanceof,catch, typehints, other language constructs and even annotations. PHP does not do this and just stays silent instead.
Contributor
Author
There was a problem hiding this comment.
I think PHPStan is trying to help us avoid typos and missing imports.
soyuka
reviewed
Mar 29, 2017
| $keyValue = explode('=', $identifier); | ||
| $identifiersMap[$keyValue[0]] = $keyValue[1]; | ||
| foreach (explode(';', $id) as $identifier) { | ||
| $identifierPair = explode('=', $identifier); |
soyuka
approved these changes
Mar 29, 2017
dunglas
approved these changes
Apr 1, 2017
Member
|
@teohhanhui can you merge it in 2.0? |
Member
|
@teohhanhui do you want me to do the merge or can you handle it? |
Simperfit
approved these changes
Apr 7, 2017
Member
|
After double thinking about it, as it's a large patch and this problem doesn't impact users directly, I propose to merge it only in 2.0. WDYT? |
Member
|
@dunglas we can't merge this in 2.0 as the IdentifierManagerTrait was a feature introduced recently in master ;) |
8d6f7e9 to
ca31152
Compare
ca31152 to
42fd15b
Compare
Member
|
thanks @teohhanhui |
Contributor
Author
|
This needs to be backported to 2.0 |
teohhanhui
added a commit
to teohhanhui/api-platform-core
that referenced
this pull request
May 4, 2017
teohhanhui
added a commit
to teohhanhui/api-platform-core
that referenced
this pull request
May 5, 2017
teohhanhui
added a commit
to teohhanhui/api-platform-core
that referenced
this pull request
May 15, 2017
hoangnd25
pushed a commit
to hoangnd25/core
that referenced
this pull request
Feb 23, 2018
…rs-type-conversion Normalize identifiers to the correct type
hoangnd25
pushed a commit
to hoangnd25/core
that referenced
this pull request
Feb 23, 2018
hoangnd25
pushed a commit
to hoangnd25/core
that referenced
this pull request
Feb 23, 2018
…1014 Backport api-platform#1014 (also includes api-platform#907)
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.
Improve compatibility with
declare(strict_types=1);Should be backported to
2.0