-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3747 from TysonAndre/unknown-method-plugin
Fix false positives in UnknownClassElementAccesPlugin
- Loading branch information
Showing
10 changed files
with
96 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
src/068_template_typeof.php:8 PhanUndeclaredClosureScope Reference to undeclared class \TTemplateType in @phan-closure-scope | ||
src/068_template_typeof.php:9 PhanPluginUnknownObjectMethodCall Phan could not infer any class/interface types for the object of the method call $this->method() - inferred a type of (empty union type) | ||
src/068_template_typeof.php:9 PhanUndeclaredThis Variable $this is undeclared | ||
src/068_template_typeof.php:10 PhanNonClassMethodCall Call to method method on non-class type class-string<TTemplateType> | ||
src/068_template_typeof.php:10 PhanPluginUnknownObjectMethodCall Phan could not infer any class/interface types for the object of the method call $x->method() - inferred a type of class-string<TTemplateType> | ||
src/068_template_typeof.php:11 PhanTypeMismatchReturn Returning type class-string<TTemplateType> but Closure($x) is declared to return TTemplateType |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
tests/plugin_test/expected/165_dont_warn_unknown.php.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src/165_dont_warn_unknown.php:2 PhanUnreferencedFunction Possibly zero references to function \test165() | ||
src/165_dont_warn_unknown.php:4 PhanPluginUnknownObjectMethodCall Phan could not infer any class/interface types for the object of the method call $x->count() - inferred a type of (empty union type) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
function test165($x) { | ||
// Should emit PhanPluginUnknownObjectMethodCall | ||
$x->count(); | ||
} | ||
function test165b($x) { | ||
// Should not emit PhanPluginUnknownObjectMethodCall because a possible type was inferred in at least one recursive call | ||
$x->count(); | ||
} | ||
test165b(new ArrayObject()); |