-
Notifications
You must be signed in to change notification settings - Fork 73
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
Function exists checks are not passing the checker #65
Comments
|
`function_exists()` is a runtime expression with another runtime expression
as parameter. This can only be used if:
* The parameter is a constant expression
* The `\function_exists` symbol is referenced absolutely or via `use
function`.
In either way, that is not something this library should go in, as the
complexity explodes massively, and every conditional leads to two
separately checked scopes.
…On Tue, 3 Apr 2018, 22:41 Haralan Dobrev, ***@***.***> wrote:
I have code similar to:
if (function_exists('xdebug_get_function_stack')) { $trace = array_slice(array_reverse(xdebug_get_function_stack()), 4);}
So running this with XDebug extension would get the trace differently, but
it could work without XDebug. There could be other conditional uses of a
function or a class, especially for backwards-compatibility.
However, the checker complains about these function uses as the parses
doesn't detect the function_exists condition.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#65>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAJakG-09rtpRRxoGa-L75XYC8_Aur8Gks5tk957gaJpZM4TFwOs>
.
|
Update to Codeception 4.x
I just encounter the issue with code like
It's the only use of CacheTokenParser and it's reported as an error by composer-require-checker. But not sure it can be solved. |
@VincentLanglet that's something you'd exclude manually via config. |
I have code similar to:
So running this with XDebug extension would get the trace differently, but it could work without XDebug. There could be other conditional uses of a function or a class, especially for backwards-compatibility.
However, the checker complains about these function uses as the parses doesn't detect the
function_exists
condition.The text was updated successfully, but these errors were encountered: