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.
Fixes compatibility issues with new syntax introduced in PHP 7.0 and 7.3
It does so by maintaining backwards compatibilidy with PHP 5.
When available uses ReflectionType in order to allow the use of nullable parameters. If it is not available that means that we are using PHP prior to 7 so no nullable parameters should exists.
ReflectionType does not allow to distinguish parameter "int $a=null" from "?int $a=null" but in fact they are equivalent and compatible signatures so in this case we prefer "int $a=null" to maintain compatibility with PHP 7.0.
The return values are always set using ReflectionType so it supports also built-in type "void" that was introduced in PHP 7.3 . Of course apart from using ReflectionType InterceptionGeneration was slightly modified to achieve this. Heavily inspired by SymfonyRotEbal@7bcc767
A new test was added to check the generation of method with ": void"
Fixes #35