-
Notifications
You must be signed in to change notification settings - Fork 132
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
Updated PHPUnit and PHPStan dependencies #400
Conversation
faa015d
to
ccf7d86
Compare
@@ -38,10 +41,13 @@ public static function createFromClosure(Closure $closure) : self | |||
{ | |||
$configuration = new BetterReflection(); | |||
|
|||
return (new FunctionReflector( | |||
/** @var self $reflectionFunction */ |
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 think you can revert this change and instead update the docblock of FunctionReflector::reflect
instead to reflect that it always returns a ReflectionFunction
. PHPStan allows that syntax.
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.
You,re right, thanks.
@@ -75,7 +75,7 @@ public static function export() : void | |||
/** | |||
* Populate the common elements of the function abstract. | |||
* | |||
* @param Node\Stmt\ClassMethod|Node\FunctionLike|Node\Stmt|Node $node Node has to be processed by the PhpParser\NodeVisitor\NameResolver | |||
* @param Node\Stmt\ClassMethod|Node\Stmt\Function_|Node\Expr\Closure $node Node has to be processed by the PhpParser\NodeVisitor\NameResolver |
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.
src/Reflection/ReflectionObject.php
Outdated
@@ -94,7 +94,10 @@ public static function createFromInstance($object) : ReflectionClass | |||
$reflector = (new BetterReflection())->classReflector(); | |||
} | |||
|
|||
return new self($reflector, $reflector->reflect($className), $object); | |||
/** @var ReflectionClass $reflectionClass */ |
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.
As above, can be in the docblock ClassReflector::reflect
instead
@@ -490,7 +490,10 @@ public function getClass() : ?ReflectionClass | |||
)); | |||
} | |||
|
|||
return $this->reflector->reflect($className); | |||
/** @var ReflectionClass $reflectionClass */ |
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.
With the above ClassReflector change, you could instead change the @var
to @var ClassReflector $reflector
src/Reflection/ReflectionType.php
Outdated
@@ -25,7 +25,7 @@ class ReflectionType | |||
]; | |||
|
|||
/** | |||
* @var $type | |||
* @var string |
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.
ccf7d86
to
f634607
Compare
@@ -140,15 +140,15 @@ private function compileClassConstFetch(Node\Expr\ClassConstFetch $node, Compile | |||
$classInfo = null; | |||
|
|||
if ($className === 'self' || $className === 'static') { | |||
$classInfo = $this->getConstantDeclaringClass($node->name, $context->getSelf()); | |||
$classInfo = $this->getConstantDeclaringClass((string) $node->name, $context->getSelf()); |
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.
This cast is unnecessary as $node->name
will always be a string here. Maybe an assert(is_string($node->name))
above would be better, and would make the other cast below unnecessary
f634607
to
ac66559
Compare
ac66559
to
2b57a99
Compare
@Ocramius Done. |
@kukulich thanks! |
No description provided.