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

Fix issues found by static analysis #394

Merged
merged 11 commits into from
Feb 4, 2018
Merged

Fix issues found by static analysis #394

merged 11 commits into from
Feb 4, 2018

Conversation

muglug
Copy link
Contributor

@muglug muglug commented Jan 5, 2018

This attempts to adhere, as much as possible, to the base Reflection* signatures. In the case of #389, I made the current different return type explicit so that changing will be a clear breaking change.

According to the docs, static ::export methods can return a value, so I allowed that even if your model does not. You may want to add an explicit return null.

Roave\BetterReflection\Reflection\Adapter\ReflectionMethod::getClosure wasn't returning a Closure, now it should.

@@ -26,7 +26,7 @@ public function __construct(BetterReflectionFunction $betterReflectionFunction)
*/
public static function export($name, $return = null)
{
BetterReflectionFunction::export(...\func_get_args());
return BetterReflectionFunction::export(...\func_get_args());
Copy link
Member

Choose a reason for hiding this comment

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

WOW that's bad O_O

@@ -180,7 +180,7 @@ public function hasProperty($name)
/**
* {@inheritDoc}
*/
public function getProperty($name)
public function getProperty($name) : ?ReflectionProperty
Copy link
Member

Choose a reason for hiding this comment

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

AFAIK, all adapters didn't really have return types. Wondering if we should change that...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can put it in the docblock?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PHP allows it...

@@ -121,6 +121,10 @@ private function compileConstFetch(Node\Expr\ConstFetch $constNode)
*/
private function compileClassConstFetch(Node\Expr\ClassConstFetch $node, CompilerContext $context)
{
if ($node->class instanceof Node\Expr || $node->name instanceof Node\Expr\Error) {
Copy link
Member

Choose a reason for hiding this comment

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

This would require also a test to reach this code location. This may as well be an assumption that is hard to code within the types we have available.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

$node->class cannot ever be a Node\Expr here, but Node\Expr\ClassConstFetch::$class can be. I suppose the error node may be possible, if you allow errors in PhpParser.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll change to a @var docblock

@@ -62,15 +62,15 @@ protected function __construct()
{
}

public static function export() : void
public static function export()
Copy link
Member

Choose a reason for hiding this comment

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

This is indeed supposed to be void

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This method inherits from a method that has a non-void return type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the parent were user-defined, a void return type would be a fatal error: https://3v4l.org/BXtvR

@@ -34,7 +34,7 @@
public const CLOSURE_NAME = '{closure}';

/**
* @var NamespaceNode
* @var ?NamespaceNode
Copy link
Member

Choose a reason for hiding this comment

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

NamespaceNode|null

@@ -510,7 +510,7 @@ public function setBodyFromClosure(Closure $newBody) : void
*/
public function setBodyFromString(string $newBody) : void
{
$this->node->stmts = $this->loadStaticParser()->parse('<?php ' . $newBody);
$this->node->stmts = $this->loadStaticParser()->parse('<?php ' . $newBody) ?: [];
Copy link
Member

Choose a reason for hiding this comment

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

Hmm... the parser should never yield non-arrays...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In theory it can yield null just based on the return type.

@@ -184,6 +184,14 @@ private function parseDefaultValueNode() : void
$defaultValueNode = $this->node->default;

if ($defaultValueNode instanceof Node\Expr\ClassConstFetch) {
if ($defaultValueNode->class instanceof Node\Expr) {
Copy link
Member

Choose a reason for hiding this comment

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

Same scenario as above - this would require a test case

@@ -67,7 +67,7 @@ private function __construct()
{
}

public static function export() : void
public static function export()
Copy link
Member

Choose a reason for hiding this comment

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

This is indeed void

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This method inherits from a method that has a non-void return type

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

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

Choose a reason for hiding this comment

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

👍

@@ -87,7 +87,7 @@ public function __construct(
$this->astConversionStrategy = $astConversionStrategy;
}

public function enterNode(Node $node) : void
Copy link
Member

Choose a reason for hiding this comment

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

These should be kept

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This method inherits from a method that has a non-void return type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added an @inheritDoc annotation instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Btw this issue is documented here: phpstan/phpstan#729 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, ok - makes sense to drop these at least for now 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will revert this change though, per #394 (comment)

@@ -25,7 +25,7 @@ class FileIteratorSourceLocator implements SourceLocator
private $aggregateSourceLocator;

/**
* @var \Iterator|\SplFileInfo[]
* @var \Iterator<\SplFileInfo>
Copy link
Collaborator

Choose a reason for hiding this comment

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

@muglug Is there an editor that can understand this? I don't think that eg. PHPStorm supports this syntax.

Copy link
Contributor Author

@muglug muglug Jan 5, 2018

Choose a reason for hiding this comment

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

I don't think so? But it's a logical syntax for an iterator that only contains SplFileInfo.

The union type that works in PHPStorm - \Iterator|\SplFileInfo[] - is illogical, since it implies the property can accept arrays.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree it's logical but this syntax is not supported in editors and other tools (eg. PHPCS).

https://github.com/phpDocumentor/fig-standards/tree/master/proposed is still only a draft.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, and until people stop using broken docblocks in their code, there'll be less momentum to fix it.

I have a @psalm-var annotation for non-phpdoc-compatible types, I could add it there instead.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, until this can be fixed "properly", at least we have editor support with the \SplFileInfo[] hint, which is preferable to not figuring out types IMO :/

Copy link
Member

Choose a reason for hiding this comment

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

Syntax change indeed to be reverted here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup will do

@muglug muglug force-pushed the master branch 3 times, most recently from 25556f7 to 9996b89 Compare January 5, 2018 15:56
@muglug muglug force-pushed the master branch 2 times, most recently from 627b41c to 497395e Compare January 29, 2018 20:59
@@ -27,7 +27,7 @@ public function __construct(BetterReflectionFunction $betterReflectionFunction)
*/
public static function export($name, $return = null)
{
BetterReflectionFunction::export(...func_get_args());
return BetterReflectionFunction::export(...func_get_args());
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I know there's been a couple of comments on these, but ::export methods really do return nothing:

https://3v4l.org/uLmk8

There's certainly a discrepancy here (phpdocs vs reality), so which do we pick? What the docs/types say, or how it actually behaves? So far we've been obeying the real-world behaviour (which I'd favour, but is of course incompatible with static analysis...)

/cc @Ocramius

Copy link
Member

Choose a reason for hiding this comment

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

Reality would be better overall.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm confused. It can return e.g. https://3v4l.org/oolCP

@@ -350,7 +350,6 @@ function (ReflectionMethod $method) use ($filter) {
*/
public function getImmediateMethods(?int $filter = null) : array
{
/** @var \ReflectionMethod[] $methods */
Copy link
Member

Choose a reason for hiding this comment

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

why removing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it can be inferred easily

Copy link
Member

Choose a reason for hiding this comment

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

array_map()'s documented return value is array - unless we have generics, this isn't inferred by tooling that doesn't assume implementation details of array_map, so the change should be reverted.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, errata - it can be inferred, it's just that most tooling won't do recursive inferring of types, so this can't really be removed unless the ecosystem evolves

Copy link
Contributor Author

Choose a reason for hiding this comment

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

evolution

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll revert this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh this was also inaccurate, which is why I made the change in the first place (it shouldn't have the leading slash)

Copy link
Member

Choose a reason for hiding this comment

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

I like the pic :D

I know the tool you built is doing it, but the majority still needs to catch up ;-)

@@ -515,6 +518,7 @@ public function setBodyFromClosure(Closure $newBody) : void
*/
public function setBodyFromString(string $newBody) : void
{
/** @var Node[] $this->node->stmts */
Copy link
Member

Choose a reason for hiding this comment

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

I haven't checked, but does PhpStorm (or other IDEs) actually support this syntax? o_O also, can this not be inferred anyway? And finally, why are we documenting the type when it's not actually used anywhere later?

Copy link
Member

Choose a reason for hiding this comment

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

No, this syntax is not supported

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll remove

also, can this not be inferred anyway

The method can return null here

* @param Class_|Interface_|Trait_ $classNode
*/
private function addClassModifiers(Declaration $classNode, CoreReflectionClass $classReflection) : void
private function addClassModifiers(Class_ $classNode, CoreReflectionClass $classReflection) : void
Copy link
Member

Choose a reason for hiding this comment

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

Is ClassLike not more appropriate here? As this would no longer accept Interface_ or Trait_ I think, which I believe should be accepted so we can make them abstract (unless I'm mistaken)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Traits/Interfaces can't be abstract though? Or final?

Copy link
Member

Choose a reason for hiding this comment

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

No fix needed

@@ -64,11 +64,20 @@ public function __invoke(CoreReflectionClass $classReflection) : string
{
$classNode = $this->createClass($classReflection);

$this->addClassModifiers($classNode, $classReflection);
if ($classNode instanceof Class_) {
$this->addClassModifiers($classNode, $classReflection);
Copy link
Member

Choose a reason for hiding this comment

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

Interface_ and Trait_ should be passed here too

Copy link
Contributor Author

@muglug muglug Jan 31, 2018

Choose a reason for hiding this comment

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

How can we have abstract/final interfaces or traits?

Copy link
Member

Choose a reason for hiding this comment

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

No fix needed

@@ -25,7 +25,7 @@ class FileIteratorSourceLocator implements SourceLocator
private $aggregateSourceLocator;

/**
* @var \Iterator|\SplFileInfo[]
* @var \Iterator<\SplFileInfo>
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, until this can be fixed "properly", at least we have editor support with the \SplFileInfo[] hint, which is preferable to not figuring out types IMO :/

@@ -87,7 +87,7 @@ public function __construct(
$this->astConversionStrategy = $astConversionStrategy;
}

public function enterNode(Node $node) : void
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, ok - makes sense to drop these at least for now 👍

@@ -27,7 +27,7 @@ public function __construct(BetterReflectionFunction $betterReflectionFunction)
*/
public static function export($name, $return = null)
{
BetterReflectionFunction::export(...func_get_args());
return BetterReflectionFunction::export(...func_get_args());
Copy link
Member

Choose a reason for hiding this comment

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

Reality would be better overall.

@@ -34,7 +34,7 @@ public function __construct(BetterReflectionMethod $betterReflectionMethod)
*/
public static function export($class, $name, $return = null)
{
BetterReflectionMethod::export(...func_get_args());
return BetterReflectionMethod::export(...func_get_args());
Copy link
Member

Choose a reason for hiding this comment

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

Same here: to be reverted

@@ -313,7 +313,7 @@ public function isDestructor()
public function getClosure($object = null)
{
try {
$this->betterReflectionMethod->getClosure($object);
return $this->betterReflectionMethod->getClosure($object);
Copy link
Member

Choose a reason for hiding this comment

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

Looks like we never tested this - that's needed here

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, this needs a test addition too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Test added in 74ba592

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

@@ -175,7 +175,9 @@ public function hasProperty($name)
}

/**
* {@inheritDoc}
* @param string $name
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't change the parent API in the Adapter ns

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See #389

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Handled in #391

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted

@@ -184,7 +184,9 @@ public function hasProperty($name)
}

/**
* {@inheritDoc}
* @param string $name
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't change the documented API in the Adapter ns

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You already have, though - documented here

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, but that bug is being fixed. This needs revert or we can wait for the other patch to go in before reverting

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted

/**
* {@inheritDoc}
*/
public function enterNode(Node $node)
Copy link
Member

Choose a reason for hiding this comment

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

: void is to be kept - would highlight changes in the parent API.

/**
* {@inheritDoc}
*/
public function enterNode(Node $node)
Copy link
Member

Choose a reason for hiding this comment

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

: void is to be kept - would highlight changes in the parent API.

/**
* {@inheritDoc}
*/
public function leaveNode(Node $node)
Copy link
Member

Choose a reason for hiding this comment

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

: void is to be kept - would highlight changes in the parent API.

@@ -25,7 +25,7 @@ class FileIteratorSourceLocator implements SourceLocator
private $aggregateSourceLocator;

/**
* @var \Iterator|\SplFileInfo[]
* @var \Iterator<\SplFileInfo>
Copy link
Member

Choose a reason for hiding this comment

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

Syntax change indeed to be reverted here.

@@ -35,17 +35,28 @@ public function __invoke(?Namespace_ $namespace) : Context
private function aliasesToFullyQualifiedNames(Namespace_ $namespace) : array
{
// flatten(flatten(map(stuff)))
return array_merge([], ...array_merge([], ...array_map(function ($use) : array {
/** @var $use Use_|GroupUse */
return array_merge(
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand what was changed here, since the alignment was changed. The operation was simply turning array[][] into array, but I don't see the diff nodes affected here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changing /** @var $use Use_|GroupUse */ to /** @param Use_|GroupUse $use */

Copy link
Member

Choose a reason for hiding this comment

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

Seems related to https://github.com/Roave/BetterReflection/pull/394/files#r164988430 - type is being inferred over implementation of array_map(). LGTM.

Copy link
Contributor Author

@muglug muglug Feb 3, 2018

Choose a reason for hiding this comment

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

Not totally related. Psalm has a MissingDocblockType that triggers for @var $var Type annotations. When I had a look at this, it made sense to not only fix the order but change it to a @param.

Psalm doesn't project types into closures, so it's not able to infer this, but it does check the boundaries – e.g. it sees the error in

class A {}
class B {}

$as = [new A(), new B()];

$classes = array_map(
  function(B $a) : string {
    return "hello";
  },
  $as
);

(I don't have link generation set up, but you can always paste into getpsalm.org to verify)

Copy link
Member

Choose a reason for hiding this comment

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

👍

@muglug
Copy link
Contributor Author

muglug commented Jan 31, 2018

@Ocramius w/r/t enterNode/leaveNode, do you think a static analysis tool should treat a void return as equal to a null one?

Currently PHPStan doesn’t check return type equality or covariance of docblock return types, allowing you to do whatever you want.

I could add a workaround that allows : void when the upstream return type is only in a docblock (and nullable). That would acknowledge that, as far as PHP is concerned, the function returns null.

Once PHPStan starts using BetterReflection I imagine these issues will pop up there, too.

@Ocramius
Copy link
Member

@muglug : void is covariant with : null (if we ever had null), so I think that it is correct to allow it.

@muglug
Copy link
Contributor Author

muglug commented Feb 1, 2018

@Ocramius patched here

@muglug muglug force-pushed the master branch 2 times, most recently from 3fb0330 to 3d7a27a Compare February 2, 2018 21:21
@muglug
Copy link
Contributor Author

muglug commented Feb 2, 2018

I've removed the unnecessary return statements in export static methods that always threw exceptions anyway.

@@ -184,7 +184,9 @@ public function hasProperty($name)
}

/**
* {@inheritDoc}
* @param string $name
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, but that bug is being fixed. This needs revert or we can wait for the other patch to go in before reverting

@@ -175,7 +175,9 @@ public function hasProperty($name)
}

/**
* {@inheritDoc}
* @param string $name
Copy link
Member

Choose a reason for hiding this comment

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

@@ -350,7 +350,6 @@ function (ReflectionMethod $method) use ($filter) {
*/
public function getImmediateMethods(?int $filter = null) : array
{
/** @var \ReflectionMethod[] $methods */
Copy link
Member

Choose a reason for hiding this comment

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

array_map()'s documented return value is array - unless we have generics, this isn't inferred by tooling that doesn't assume implementation details of array_map, so the change should be reverted.

@@ -35,17 +35,28 @@ public function __invoke(?Namespace_ $namespace) : Context
private function aliasesToFullyQualifiedNames(Namespace_ $namespace) : array
{
// flatten(flatten(map(stuff)))
return array_merge([], ...array_merge([], ...array_map(function ($use) : array {
/** @var $use Use_|GroupUse */
return array_merge(
Copy link
Member

Choose a reason for hiding this comment

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

Seems related to https://github.com/Roave/BetterReflection/pull/394/files#r164988430 - type is being inferred over implementation of array_map(). LGTM.

@@ -313,7 +313,7 @@ public function isDestructor()
public function getClosure($object = null)
{
try {
$this->betterReflectionMethod->getClosure($object);
return $this->betterReflectionMethod->getClosure($object);
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, this needs a test addition too

@@ -130,6 +130,7 @@ private function compileConstFetch(Node\Expr\ConstFetch $constNode)
*/
private function compileClassConstFetch(Node\Expr\ClassConstFetch $node, CompilerContext $context)
{
/** @var Node\Name $node->class */
Copy link
Member

Choose a reason for hiding this comment

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

This syntax is not really compatible with most tooling out there - what should we do about it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If it breaks anything I'm happy to remove it, or replace with an assert.

My hope is that the PSR-5 PHPDoc proposal is approved, and the people who make similar tools add support for this. It's a common-sense annotation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is also that could be fixed with a Psalm config, as it relates to behaviour of PhpParser that will never occur given how it's used in BetterReflection. vimeo/psalm#482 would fix that internally.

Anyway, using an assert also fixes a PHPStan error at the same location so maybe that's the way to go here.

Copy link
Member

Choose a reason for hiding this comment

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

Let's keep them for now 👍

@@ -148,6 +149,7 @@ private function compileClassConstFetch(Node\Expr\ClassConstFetch $node, Compile
$classInfo = $context->getReflector()->reflect($className);
}

/** @var string $node->name */
Copy link
Member

Choose a reason for hiding this comment

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

Same question about compatibility: what to do here?

Copy link
Member

Choose a reason for hiding this comment

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

Let's keep this for now

@Ocramius Ocramius added this to the 3.0.0 milestone Feb 4, 2018
@@ -67,7 +69,7 @@ public function methodExpectationProvider() : array
['isUserDefined', null, true, []],
['getClosureThis', NotImplemented::class, null, []],
['getClosureScopeClass', NotImplemented::class, null, []],
['getDocComment', null, '', []],
['getDocComment', null, false, []],
Copy link
Member

Choose a reason for hiding this comment

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

Nice catch here 👍

Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Let's 🚢 this :)

Thanks @muglug for keeping up with our extremely lengthy and annoying review process ^_^

@Ocramius Ocramius merged commit 4cb957e into Roave:master Feb 4, 2018
@muglug
Copy link
Contributor Author

muglug commented Feb 4, 2018

@Ocramius totally worth it for the improvements it forced me to make to Psalm. Thanks for taking your time with it!

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.

4 participants