File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
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.2.5] - 2020-MM-DD
6+
7+ ### Fixed
8+
9+ * [ #831 ] ( https://github.com/sebastianbergmann/php-code-coverage/issues/831 ) : Files that do not contain a newline are not handled correctly
10+
511## [ 9.2.4] - 2020-11-27
612
713### Added
@@ -312,6 +318,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
312318* Class names are now abbreviated (unqualified name shown, fully qualified name shown on hover) in the file view of the HTML report
313319* Update HTML report to Bootstrap 4
314320
321+ [ 9.2.5 ] : https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.4...master
315322[ 9.2.4 ] : https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.3...9.2.4
316323[ 9.2.3 ] : https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.2...9.2.3
317324[ 9.2.2 ] : https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.1...9.2.2
Original file line number Diff line number Diff line change @@ -120,6 +120,10 @@ private function analyse(string $filename): void
120120 $ source = file_get_contents ($ filename );
121121 $ linesOfCode = substr_count ($ source , "\n" );
122122
123+ if ($ linesOfCode === 0 && !empty ($ source )) {
124+ $ linesOfCode = 1 ;
125+ }
126+
123127 $ parser = (new ParserFactory )->create (
124128 ParserFactory::PREFER_PHP7 ,
125129 new Lexer
You can’t perform that action at this time.
0 commit comments