File tree Expand file tree Collapse file tree 4 files changed +18
-3
lines changed Expand file tree Collapse file tree 4 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 22
33All notable changes are documented in this file using the [ Keep a CHANGELOG] ( http://keepachangelog.com/ ) principles.
44
5+ ## [ 9.1.3] - 2020-MM-DD
6+
7+ ### Changed
8+
9+ * Changed PHP-Parser usage to parse sourcecode according to the PHP version we are currently running on instead of using emulative lexing
10+
511## [ 9.1.2] - 2020-08-10
612
713### Fixed
@@ -207,6 +213,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
207213* Class names are now abbreviated (unqualified name shown, fully qualified name shown on hover) in the file view of the HTML report
208214* Update HTML report to Bootstrap 4
209215
216+ [ 9.1.3 ] : https://github.com/sebastianbergmann/php-code-coverage/compare/9.1.2...master
210217[ 9.1.2 ] : https://github.com/sebastianbergmann/php-code-coverage/compare/9.1.1...9.1.2
211218[ 9.1.1 ] : https://github.com/sebastianbergmann/php-code-coverage/compare/9.1.0...9.1.1
212219[ 9.1.0 ] : https://github.com/sebastianbergmann/php-code-coverage/compare/9.0.0...9.1.0
Original file line number Diff line number Diff line change 3232 "ext-dom" : " *" ,
3333 "ext-libxml" : " *" ,
3434 "ext-xmlwriter" : " *" ,
35- "nikic/php-parser" : " ^4.7 " ,
35+ "nikic/php-parser" : " ^4.8 " ,
3636 "phpunit/php-file-iterator" : " ^3.0.3" ,
3737 "phpunit/php-text-template" : " ^2.0.2" ,
3838 "sebastian/code-unit-reverse-lookup" : " ^2.0.2" ,
Original file line number Diff line number Diff line change 1818use function token_get_all ;
1919use function trim ;
2020use PhpParser \Error ;
21+ use PhpParser \Lexer ;
2122use PhpParser \NodeTraverser ;
2223use PhpParser \NodeVisitor \NameResolver ;
2324use PhpParser \NodeVisitor \ParentConnectingVisitor ;
@@ -116,7 +117,10 @@ private function analyse(string $filename): void
116117 $ source = file_get_contents ($ filename );
117118 $ linesOfCode = substr_count ($ source , "\n" );
118119
119- $ parser = (new ParserFactory )->create (ParserFactory::PREFER_PHP7 );
120+ $ parser = (new ParserFactory )->create (
121+ ParserFactory::PREFER_PHP7 ,
122+ new Lexer
123+ );
120124
121125 try {
122126 $ nodes = $ parser ->parse ($ source );
Original file line number Diff line number Diff line change 1010namespace SebastianBergmann \CodeCoverage \StaticAnalysis ;
1111
1212use PhpParser \Error ;
13+ use PhpParser \Lexer ;
1314use PhpParser \NodeTraverser ;
1415use PhpParser \ParserFactory ;
1516
1617final class ParsingUncoveredFileAnalyser implements UncoveredFileAnalyser
1718{
1819 public function executableLinesIn (string $ filename ): array
1920 {
20- $ parser = (new ParserFactory )->create (ParserFactory::PREFER_PHP7 );
21+ $ parser = (new ParserFactory )->create (
22+ ParserFactory::PREFER_PHP7 ,
23+ new Lexer
24+ );
2125
2226 try {
2327 $ nodes = $ parser ->parse (file_get_contents ($ filename ));
You can’t perform that action at this time.
0 commit comments