File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 29
29
"gossi/docblock" : " ~1" ,
30
30
"gossi/php-code-profiles" : " dev-master" ,
31
31
"gossi/php-code-formatter" : " dev-master" ,
32
- "symfony/options-resolver" : " ^3|^4 " ,
32
+ "symfony/options-resolver" : " ^4|^3 " ,
33
33
"phootwork/file" : " ~0" ,
34
34
"phootwork/tokenizer" : " ~0" ,
35
- "nikic/php-parser" : " ~ 3|^4 "
35
+ "nikic/php-parser" : " ^4|^ 3|^2|^1 "
36
36
},
37
37
"require-dev" : {
38
38
"phpunit/phpunit" : " ^5.7" ,
Original file line number Diff line number Diff line change @@ -52,8 +52,13 @@ public function parse() {
52
52
}
53
53
54
54
private function getParser () {
55
- $ factory = new \PhpParser \ParserFactory ();
56
- return $ factory ->create (\PhpParser \ParserFactory::PREFER_PHP7 );
55
+ if (class_exists ('\\PhpParser \\ParserFactory ' )) {
56
+ $ factory = new \PhpParser \ParserFactory ();
57
+ return $ factory ->create (\PhpParser \ParserFactory::PREFER_PHP7 );
58
+ } else {
59
+ // because sami v3 requires php-parser v1
60
+ return new \PhpParser \Parser (new \PhpParser \Lexer \Emulative ());
61
+ }
57
62
}
58
63
59
64
public function enterNode (Node $ node ) {
You can’t perform that action at this time.
0 commit comments