Skip to content

Commit

Permalink
Closes #971
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Dec 22, 2022
1 parent 2853234 commit d25b7e8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
12 changes: 0 additions & 12 deletions .psalm/baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,6 @@
<code>include_once $uncoveredFile</code>
</UnresolvableInclude>
</file>
<file src="src/Driver/PcovDriver.php">
<UndefinedConstant occurrences="1">
<code>inclusive</code>
</UndefinedConstant>
<UndefinedFunction occurrences="5">
<code>clear()</code>
<code>collect(inclusive, $filesToCollectCoverageFor)</code>
<code>start()</code>
<code>stop()</code>
<code>waiting()</code>
</UndefinedFunction>
</file>
<file src="src/Driver/Xdebug2Driver.php">
<UndefinedConstant occurrences="3">
<code>XDEBUG_CC_BRANCH_CHECK</code>
Expand Down
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## [9.2.23] - 2022-MM-DD

### Fixed

* [#971](https://github.com/sebastianbergmann/php-code-coverage/issues/971): PHP report does not handle serialized code coverage data larger than 2 GB

## [9.2.22] - 2022-12-18

### Fixed
Expand Down Expand Up @@ -451,6 +457,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt

* This component is no longer supported on PHP 7.1

[9.2.23]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.22...9.2
[9.2.22]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.21...9.2.22
[9.2.21]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.20...9.2.21
[9.2.20]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.19...9.2.20
Expand Down
11 changes: 2 additions & 9 deletions src/Report/PHP.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use function dirname;
use function file_put_contents;
use function serialize;
use function sprintf;
use SebastianBergmann\CodeCoverage\CodeCoverage;
use SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException;
use SebastianBergmann\CodeCoverage\Util\Filesystem;
Expand All @@ -21,14 +20,8 @@ final class PHP
{
public function process(CodeCoverage $coverage, ?string $target = null): string
{
$buffer = sprintf(
"<?php
return \unserialize(<<<'END_OF_COVERAGE_SERIALIZATION'%s%s%sEND_OF_COVERAGE_SERIALIZATION%s);",
PHP_EOL,
serialize($coverage),
PHP_EOL,
PHP_EOL
);
$buffer = "<?php
return \unserialize(<<<'END_OF_COVERAGE_SERIALIZATION'" . PHP_EOL . serialize($coverage) . PHP_EOL . 'END_OF_COVERAGE_SERIALIZATION' . PHP_EOL . ');';

if ($target !== null) {
Filesystem::createDirectory(dirname($target));
Expand Down

0 comments on commit d25b7e8

Please sign in to comment.