-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
WIP [Meta] Add PHPStan to build process #25536
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
Changes from 1 commit
e1be251
bfb3048
9183062
d9e30ae
83c1208
bdeda31
0a33eb1
a7dff25
03daa41
da9d0e4
75403df
c5467e0
dbdf9de
5fc8d8e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,7 @@ public function handleError(array $error, FatalErrorException $exception) | |
} | ||
|
||
$candidates = array(); | ||
foreach (get_defined_functions() as $type => $definedFunctionNames) { | ||
foreach (get_defined_functions(false) as $type => $definedFunctionNames) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the function takes no arguments, why this here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might be a false positive, it takes an optional param since 7.0.15: http://php.net/manual/en/function.get-defined-functions.php#refsect1-function.get-defined-functions-parameters There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, should be removed imho as it's the default value, and may break BC There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, I'll report it to PHPStan, don't know why it was asked for here. |
||
foreach ($definedFunctionNames as $definedFunctionName) { | ||
if (false !== $namespaceSeparatorIndex = strrpos($definedFunctionName, '\\')) { | ||
$definedFunctionNameBasename = substr($definedFunctionName, $namespaceSeparatorIndex + 1); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -258,6 +258,9 @@ function () {}, | |
|
||
public function testRecursionInArguments() | ||
{ | ||
if (!isset($a)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. useless. It will never be set there There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's used for the variable to not be undeclared in the following line. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The correct fix to help PHPStan understand the code is $a = null;
$a = array('foo', array(2, &$a)); |
||
$a = []; | ||
} | ||
$a = array('foo', array(2, &$a)); | ||
$exception = $this->createException($a); | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.
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 should be kept: the class exists in cross component versions situations
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.
Can you give an example?
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.
any project that uses debug v4 + class-loader v3.4