Skip to content
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

Merged
merged 2 commits into from
Feb 5, 2018

Conversation

kukulich
Copy link
Collaborator

@kukulich kukulich commented Feb 3, 2018

No description provided.

@@ -38,10 +41,13 @@ public static function createFromClosure(Closure $closure) : self
{
$configuration = new BetterReflection();

return (new FunctionReflector(
/** @var self $reflectionFunction */
Copy link
Contributor

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.

Copy link
Collaborator Author

@kukulich kukulich Feb 3, 2018

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -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 */
Copy link
Contributor

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 */
Copy link
Contributor

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

@@ -25,7 +25,7 @@ class ReflectionType
];

/**
* @var $type
* @var string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -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());
Copy link
Contributor

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

@Ocramius
Copy link
Member

Ocramius commented Feb 4, 2018

@kukulich rebase needed as per #394 changes

@kukulich
Copy link
Collaborator Author

kukulich commented Feb 4, 2018

@Ocramius Done.

@Ocramius
Copy link
Member

Ocramius commented Feb 5, 2018

@kukulich thanks!

@Ocramius Ocramius added this to the 3.0.0 milestone Feb 5, 2018
@Ocramius Ocramius self-assigned this Feb 5, 2018
@Ocramius Ocramius merged commit aefddb1 into Roave:master Feb 5, 2018
@kukulich kukulich deleted the dev-dependencies branch February 5, 2018 10:02
@Ocramius Ocramius changed the title PHPUnit & PHPStan updated Updated PHPUnit and PHPStan dependencies May 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants