Notice: Undefined property: PhpParser\Node\Expr\PropertyFetch::$value
Closed this issue · 3 comments
povils/phpmnd (dev-master 0471854)
$phpmnd app
phpmnd 2.1.0 by Povilas Susinskas
PHP Notice: Undefined property: PhpParser\Node\Expr\PropertyFetch::$value in /Users/xxx/xxx/vendor/povils/phpmnd/src/Visitor/DetectorVisitor.php on line 55
PHP Stack trace:
PHP 1. {main}() /Users/xxx/xxx/vendor/povils/phpmnd/bin/phpmnd:0
PHP 2. Povils\PHPMND\Console\Application->run() /Users/xxx/xxx/vendor/povils/phpmnd/bin/phpmnd:40
PHP 3. Povils\PHPMND\Console\Application->doRun() /Users/xxx/xxx/vendor/symfony/console/Application.php:145
PHP 4. Povils\PHPMND\Console\Application->doRun() /Users/xxx/xxx/vendor/povils/phpmnd/src/Console/Application.php:66
PHP 5. Povils\PHPMND\Console\Application->doRunCommand() /Users/xxx/xxx/vendor/symfony/console/Application.php:262
PHP 6. Povils\PHPMND\Console\Command->run() /Users/xxx/xxx/vendor/symfony/console/Application.php:901
PHP 7. Povils\PHPMND\Console\Command->execute() /Users/xxx/xxx/vendor/symfony/console/Command/Command.php:255
PHP 8. Povils\PHPMND\Detector->detect() /Users/xxx/xxx/vendor/povils/phpmnd/src/Console/Command.php:172
PHP 9. PhpParser\NodeTraverser->traverse() /Users/xxx/xxx/vendor/povils/phpmnd/src/Detector.php:51
PHP 10. PhpParser\NodeTraverser->traverseArray() /Users/xxx/xxx/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:91
PHP 11. PhpParser\NodeTraverser->traverseNode() /Users/xxx/xxx/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:223
PHP 12. PhpParser\NodeTraverser->traverseArray() /Users/xxx/xxx/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:114
PHP 13. PhpParser\NodeTraverser->traverseNode() /Users/xxx/xxx/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:223
PHP 14. PhpParser\NodeTraverser->traverseArray() /Users/xxx/xxx/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:114
PHP 15. PhpParser\NodeTraverser->traverseNode() /Users/xxx/xxx/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:223
PHP 16. PhpParser\NodeTraverser->traverseArray() /Users/xxx/xxx/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:114
PHP 17. PhpParser\NodeTraverser->traverseNode() /Users/xxx/xxx/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:223
PHP 18. PhpParser\NodeTraverser->traverseNode() /Users/xxx/xxx/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:146
PHP 19. PhpParser\NodeTraverser->traverseNode() /Users/xxx/xxx/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:146
PHP 20. PhpParser\NodeTraverser->traverseArray() /Users/xxx/xxx/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:114
PHP 21. PhpParser\NodeTraverser->traverseNode() /Users/xxx/xxx/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:223
PHP 22. PhpParser\NodeTraverser->traverseNode() /Users/xxx/xxx/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:146
PHP 23. PhpParser\NodeTraverser->traverseNode() /Users/xxx/xxx/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:146
PHP 24. Povils\PHPMND\Visitor\DetectorVisitor->enterNode() /Users/xxx/xxx/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:123
The rest of the checks work fine and gives the normal output
Total of Magic Numbers: 10
Time: 1.54 seconds, Memory: 124.00 MB
Thanks for reporting. Do you want to take a look?
Ive looked in to it a bit so far.
Added
if (!isset($scalar->value)) { $this->fileReport->addEntry($scalar->getLine(), 999); return null; }
found that the issue was the following line:
(float) -$transaction->amount_in_usd,
So its just when its a "-" is added in front of the variable that it cause this.
$a = 0-$transaction->amount_in_usd
doesnt cause the error
$b = -$transaction->amount_in_usd
does