Conversation
…d behaviour of ReflectionParameter::isOptional
src/ReflectionParameter.php
Outdated
There was a problem hiding this comment.
If there is a composite type, do you return Type[] or CompositeType?
There was a problem hiding this comment.
As per discussion, this returns the type hint defined in the language
There was a problem hiding this comment.
What's the problem with recursion here?
There was a problem hiding this comment.
We'd have to load a ReflectionClass instance of the class that is hinted in the language type hint, which could be the same class. Currently, because we are not autoloading classes, and the PR #3 is still WIP, we have no way of really loading a ReflectionClass for this, unless we used builtin ReflectionClass, but that kinda defeats the point. It's a mess that I need to have a think on...
There was a problem hiding this comment.
private function doLoadClass($class, & $currentlyLoaded = [])
{
if (isset($currentlyLoaded[$class])) {
return $currentlyLoaded[$class];
}
// ... possible recursion here.
}There was a problem hiding this comment.
I've created new issue #13 to investigate this - for now I'm happy to say it's currently unsupported and implement later.
src/ReflectionParameter.php
Outdated
There was a problem hiding this comment.
Split into a separate private method?
Compatibility for ReflectionParameter
As part of #7, this PR brings full compatibility with
ReflectionParameter(where possible)