[WIP] Support throwing functions#2928
Closed
Aerendir wants to merge 2 commits intorectorphp:masterfrom
Aerendir:AnnotateThrowables-support-throwing-functions
Closed
[WIP] Support throwing functions#2928Aerendir wants to merge 2 commits intorectorphp:masterfrom Aerendir:AnnotateThrowables-support-throwing-functions
Aerendir wants to merge 2 commits intorectorphp:masterfrom
Aerendir:AnnotateThrowables-support-throwing-functions
Conversation
Member
|
Why not use the same trick as with docblock and method reflection, like the last time? |
Contributor
Author
|
Because it doesn't work for functions: Nette doesn't support building the full namespace for functions, only for classes. |
Contributor
Author
|
@TomasVotruba ping |
Member
|
Ah. In that case, you need to solve the behavior yourself with: $node->getAttribute(AttributeKey::USE_NODES)Foreach it and match the propper name |
Member
|
Here is some inspiration: Just instead of |
Contributor
Author
|
Ok, I will try this way... |
TomasVotruba
reviewed
Mar 3, 2020
Contributor
Author
|
Too many errors: I will send a clean PR. |
4 tasks
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.
The goal of this PR is to support functions and methods that use functions that may throw exceptions.
PROBLEM
Currently it is not possible to build the full namespace of the thrown class.
@TomasVotruba , any ideas about how to proceed to get the full namespace of the thrown classes?
Relevant code:
In the commit there is the dump in HTML format that may be useful.