-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Unknown node error #13
Comments
Hello @BafS Eric |
Unfortunately it's private code but <?php
function test(): ?int {
return 1;
} is enough to trigger |
it's a bug in a dependency used by progpilot : https://github.com/ircmaxell/php-cfg the test cases I have developed with your help to reproduce the bugs : cd designsecurity/progpilot/project/tests/
php testphpcfg.php ./tests/negative/parser_error2.php
PHP Fatal error: Uncaught RuntimeException: Unknown Expr Type NullableType in /home/eric/dev/designsecurity/progpilot/projects/tests/vendor/ircmaxell/php-cfg/lib/PHPCfg/Parser.php:799 Could you submit these issues in the ircmaxell/php-cfg repository ? |
Thanks ! I see that someone have the same problem already ircmaxell/php-cfg#49 |
@eric-therond Why isn't progpilot using your fork of php-cfg with the fix you made? |
Someone asked how to include the fork instead, but deleted their question. So here it is anyway: diff --git a/composer.json b/composer.json
index 4b77081..b34d0ec 100644
--- a/composer.json
+++ b/composer.json
@@ -8,9 +8,15 @@
"email": "eric.therond.fr@gmail.com"
}
],
+ "repositories": [
+ {
+ "type": "vcs",
+ "url": "https://github.com/eric-therond/php-cfg"
+ }
+ ],
"require": {
"php": "^7.0",
- "ircmaxell/php-cfg": "^0.5",
+ "ircmaxell/php-cfg": "dev-master",
"symfony/yaml": ">=3.3.6",
"symfony/console": ">=3.3.5"
}, |
yep it s me because i though i found the solution trying the latest ircmaxwell (@dev) in composer.json because according to me it was fixed in latest release but got another issue. Thanks @NicolasCARPi, gonna test it with the fork. |
Still got Unknown
and last progpilot release 0.6.0. I'm trying to audit a Zend application.
How i installed it:
Thanks, |
Well, if you use the .phar, the custom composer.json has no effect! |
My bad i was meaning i tried the released one (failed) and this one:
With launch.php:
Just got:
Pretty weirdo, it works on a simple php test file. btw thanks for your quick replies @NicolasCARPi |
@phackt which file are you trying to analyze ? |
@eric-therond Any code with a nullable type hint: a.php: <?php
function blah(?string $nullable): string
{
if ($nullable) {
return 'yep';
}
return 'nope';
} ./progpilot_v0.6.0.phar a.php
Unknown Expr Type NullableType |
yes for this one it's corrected in the v1.0 ircmaxell/php-cfg branch but there is no stable version for the moment and there are other similar bugs like ircmaxell/php-cfg#58 but it seems @phackt has a different issue related to progpilot itself:
I can't reproduce this bug without your inputs |
I can reproduce the error
with the following code:
|
I have updated dependency ircmaxell/php-cfg to 1.0.x-dev even if it is not a stable version. Thanks |
@eric-therond Looks like it works now :) 👍 |
Some node types are not handle, I tried to run progpilot on some projects using nullable type or group use and I have those errors:
Unknown Stmt Node Encountered : Stmt_GroupUse
Unknown Expr Type NullableType
The text was updated successfully, but these errors were encountered: