-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[PropertyInfo] Extract property type from property declaration #31798
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4baeb0c
[PropertyInfo] Extract type from property declaration
tsantos84 e903eeb
[PropertyInfo] Add PHP 7.4-dev to travisci
tsantos84 e71852d
[PropertyInfo] Change log note
tsantos84 550c4d2
[PropertyInfo] Change variable name
tsantos84 afaea21
[PropertyInfo] Remove callable from tests
tsantos84 d11d8f0
[PropertyInfo] Add copyright text
tsantos84 f2b5c1a
[PropertyInfo] Add test case for iterable type
tsantos84 72ee401
[PropertyInfo] Add `self` and `parent` type
tsantos84 2a273c1
[PropertyInfo] Prevent exception in case the property doesn't exist
tsantos84 4e5bfe1
[PropertyInfo] Fix code standard
tsantos84 2f8b2fe
[PropertyInfo] Fix PHP version comparison
tsantos84 7f1095d
[PropertyInfo] Unifying $reflector argument to keep code cleaner
tsantos84 92e8be6
[PropertyInfo] Fix code standard
tsantos84 d6c3e5a
[PropertyInfo] Remove typehint for $resolver argument
tsantos84 bc8d70c
[PropertyInfo] Change exception
tsantos84 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[PropertyInfo] Prevent exception in case the property doesn't exist
- Loading branch information
commit 2a273c11bf03dca98d09557dd741710d057df834
There are no files selected for viewing
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
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
2E3A
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To prevent test fails you can add following code here:
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or you can expand try-catch block for the whole function content (to prevent errors, which can happen while calling
hasType
,getProperty
,getType
etc. which can throw ReflectionException).I think the best option - add either
hasProperty
or expand try-catch.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've used the same
try/catch
block where I create the reflection class to get the property, and if it doesn't exist, it'll returnnull