Comments (5)
I now have a workaround. But it hits in the nikic/php-parser library.
Index: vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php (revision )
+++ vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php (revision )
@@ -140,10 +140,15 @@
$symbol = $tokenId >= 0 && $tokenId < $this->tokenToSymbolMapSize
? $this->tokenToSymbol[$tokenId]
: $this->invalidSymbol;
if ($symbol === $this->invalidSymbol) {
+
+ //In hhvm (script)files that start with unix annotations like "#!/usr/bin/env php" crashes the lexer and this part. This is a workaround.
+ if(substr($tokenValue, 0, 2) == "#!") {
+ continue;
+ }
+
throw new \RangeException(sprintf(
'The lexer returned an invalid token (id=%d, value=%s)',
$tokenId, $tokenValue
));
}
from phpdependencyanalysis.
Hi,
sorry for late answer..a lot of todos on my side ;)
I think its a good approach to ask Nikita Popov (owner of https://github.com/nikic/PHP-Parser) directly for this issue.
BTW: Unix annotations like "#!..." are called shebang (http://en.wikipedia.org/wiki/Shebang_(Unix))
Hopefully i will find time to investigate it, too.
from phpdependencyanalysis.
Php-Parser added hashbang support nikic/PHP-Parser@592836c
Waiting for release, after that everything should be fine.
from phpdependencyanalysis.
Hi @otruffer,
latest Release v0.4.1 includes dependency update to phpParser to 1.2.*
Shebang issue under hhvm should be fixed now.
from phpdependencyanalysis.
Hi
Thanks a lot for your work!
Cheers
Oskar
from phpdependencyanalysis.
Related Issues (20)
- Add a PHAR HOT 3
- Unable to invoke "dot" to create image file HOT 1
- Hanging on writing to dependency graph file HOT 1
- @see tag is interpreted wrong HOT 3
- Multiple output formats for one analysis run
- phpda not taking relative paths to config file
- Is there way to ignore built-in functions? HOT 6
- Config File Name HOT 1
- can source in config be array? HOT 1
- Symfony 4? HOT 1
- PHP 7.1 Support HOT 2
- namespaceFilter plugin is never called on global namespace
- Packagist still on v1.3.1 - can you update it, or setup auto update HOT 2
- Question: Usage graph for single class HOT 1
- Is this a code analysis tool or a static analysis one? HOT 1
- Array union types aren't handled properly
- Write dependency graph is not working or is taking too much time HOT 1
- Syntax error thrown due to invalid subgraph groupid
- Composer package is no longer installable HOT 2
- Install fails in PHP 8.1 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpdependencyanalysis.