Dependency updates and update version number

This commit is contained in:
Kode
2018-06-13 19:35:28 +01:00
parent 18ec208381
commit e3ec7de23a
1261 changed files with 45582 additions and 29687 deletions

View File

@@ -2,6 +2,22 @@
All notable changes of the PHP_CodeCoverage 5.3 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
## [5.3.2] - 2018-04-06
### Fixed
* Fixed [#602](https://github.com/sebastianbergmann/php-code-coverage/pull/602): Regression introduced in version 5.3.1
## [5.3.1] - 2018-04-06
### Changed
* `Clover`, `Crap4j`, and `PHP` report writers now raise an exception when their call to `file_put_contents()` fails
### Fixed
* Fixed [#559](https://github.com/sebastianbergmann/php-code-coverage/issues/559): Ignored classes and methods are reported as 100% covered
## [5.3.0] - 2017-12-06
### Added
@@ -12,5 +28,7 @@ All notable changes of the PHP_CodeCoverage 5.3 release series are documented in
* Fixed [#564](https://github.com/sebastianbergmann/php-code-coverage/issues/564): `setDisableIgnoredLines(true)` disables more than it should
[5.3.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/5.3.1...5.3.2
[5.3.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/5.3.0...5.3.1
[5.3.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/5.2...5.3.0

View File

@@ -12,6 +12,7 @@ namespace SebastianBergmann\CodeCoverage\Report;
use SebastianBergmann\CodeCoverage\CodeCoverage;
use SebastianBergmann\CodeCoverage\Node\File;
use SebastianBergmann\CodeCoverage\RuntimeException;
/**
* Generates a Clover XML logfile from a code coverage object.
@@ -24,6 +25,8 @@ class Clover
* @param string $name
*
* @return string
*
* @throws \SebastianBergmann\CodeCoverage\RuntimeException
*/
public function process(CodeCoverage $coverage, $target = null, $name = null)
{
@@ -243,7 +246,14 @@ class Clover
\mkdir(\dirname($target), 0777, true);
}
\file_put_contents($target, $buffer);
if (@\file_put_contents($target, $buffer) === false) {
throw new RuntimeException(
\sprintf(
'Could not write to "%s',
$target
)
);
}
}
return $buffer;

View File

@@ -13,6 +13,7 @@ namespace SebastianBergmann\CodeCoverage\Report;
use SebastianBergmann\CodeCoverage\CodeCoverage;
use SebastianBergmann\CodeCoverage\InvalidArgumentException;
use SebastianBergmann\CodeCoverage\Node\File;
use SebastianBergmann\CodeCoverage\RuntimeException;
class Crap4j
{
@@ -42,6 +43,8 @@ class Crap4j
* @param string $name
*
* @return string
*
* @throws \SebastianBergmann\CodeCoverage\RuntimeException
*/
public function process(CodeCoverage $coverage, $target = null, $name = null)
{
@@ -135,7 +138,14 @@ class Crap4j
\mkdir(\dirname($target), 0777, true);
}
\file_put_contents($target, $buffer);
if (@\file_put_contents($target, $buffer) === false) {
throw new RuntimeException(
\sprintf(
'Could not write to "%s',
$target
)
);
}
}
return $buffer;

View File

@@ -131,19 +131,23 @@ class File extends Renderer
*/
protected function renderTraitOrClassItems(array $items, \Text_Template $template, \Text_Template $methodItemTemplate)
{
if (empty($items)) {
return '';
}
$buffer = '';
if (empty($items)) {
return $buffer;
}
foreach ($items as $name => $item) {
$numMethods = \count($item['methods']);
$numMethods = 0;
$numTestedMethods = 0;
foreach ($item['methods'] as $method) {
if ($method['executedLines'] == $method['executableLines']) {
$numTestedMethods++;
if ($method['executableLines'] > 0) {
$numMethods++;
if ($method['executedLines'] === $method['executableLines']) {
$numTestedMethods++;
}
}
}
@@ -244,7 +248,16 @@ class File extends Renderer
*/
protected function renderFunctionOrMethodItem(\Text_Template $template, array $item, $indent = '')
{
$numTestedItems = $item['executedLines'] == $item['executableLines'] ? 1 : 0;
$numMethods = 0;
$numTestedMethods = 0;
if ($item['executableLines'] > 0) {
$numMethods = 1;
if ($item['executedLines'] === $item['executableLines']) {
$numTestedMethods = 1;
}
}
return $this->renderItemTemplate(
$template,
@@ -256,8 +269,8 @@ class File extends Renderer
\htmlspecialchars($item['signature']),
isset($item['functionName']) ? $item['functionName'] : $item['methodName']
),
'numMethods' => 1,
'numTestedMethods' => $numTestedItems,
'numMethods' => $numMethods,
'numTestedMethods' => $numTestedMethods,
'linesExecutedPercent' => Util::percent(
$item['executedLines'],
$item['executableLines'],
@@ -271,12 +284,12 @@ class File extends Renderer
'numExecutedLines' => $item['executedLines'],
'numExecutableLines' => $item['executableLines'],
'testedMethodsPercent' => Util::percent(
$numTestedItems,
$numTestedMethods,
1,
false
),
'testedMethodsPercentAsString' => Util::percent(
$numTestedItems,
$numTestedMethods,
1,
true
),

View File

@@ -11,6 +11,7 @@
namespace SebastianBergmann\CodeCoverage\Report;
use SebastianBergmann\CodeCoverage\CodeCoverage;
use SebastianBergmann\CodeCoverage\RuntimeException;
/**
* Uses var_export() to write a SebastianBergmann\CodeCoverage\CodeCoverage object to a file.
@@ -27,7 +28,7 @@ class PHP
{
$filter = $coverage->filter();
$output = \sprintf(
$buffer = \sprintf(
'<?php
$coverage = new SebastianBergmann\CodeCoverage\CodeCoverage;
$coverage->setData(%s);
@@ -43,9 +44,16 @@ return $coverage;',
);
if ($target !== null) {
return \file_put_contents($target, $output);
} else {
return $output;
if (@\file_put_contents($target, $buffer) === false) {
throw new RuntimeException(
\sprintf(
'Could not write to "%s',
$target
)
);
}
}
return $buffer;
}
}

View File

@@ -22,7 +22,7 @@ class Version
public static function id()
{
if (self::$version === null) {
$version = new VersionId('5.3.0', \dirname(__DIR__));
$version = new VersionId('5.3.2', \dirname(__DIR__));
self::$version = $version->getVersion();
}

View File

@@ -65,16 +65,11 @@
</tr>
<tr>
<td class="success" colspan="4"><a href="#28"><abbr title="baz()">baz</abbr></a></td>
<td class="success big"> <div class="progress">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">1&nbsp;/&nbsp;1</div></td>
<td class="success small">1</td>
<td class="" colspan="4"><a href="#28"><abbr title="baz()">baz</abbr></a></td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
<td class=" small">1</td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
@@ -85,31 +80,21 @@
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
<td class="success big"> <div class="progress">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">1&nbsp;/&nbsp;1</div></td>
<td class="success small">1</td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
<td class=" small">1</td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
</tr>
<tr>
<td class="success" colspan="4">&nbsp;<a href="#13"><abbr title="bar()">bar</abbr></a></td>
<td class="success big"> <div class="progress">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">1&nbsp;/&nbsp;1</div></td>
<td class="success small">1</td>
<td class="" colspan="4">&nbsp;<a href="#13"><abbr title="bar()">bar</abbr></a></td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
<td class=" small">1</td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
@@ -120,31 +105,21 @@
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
<td class="success big"> <div class="progress">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">1&nbsp;/&nbsp;1</div></td>
<td class="success small">1</td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
<td class=" small">1</td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
</tr>
<tr>
<td class="success" colspan="4">&nbsp;<a href="#23"><abbr title="foo()">foo</abbr></a></td>
<td class="success big"> <div class="progress">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
<span class="sr-only">100.00% covered (success)</span>
</div>
</div>
</td>
<td class="success small"><div align="right">100.00%</div></td>
<td class="success small"><div align="right">1&nbsp;/&nbsp;1</div></td>
<td class="success small">1</td>
<td class="" colspan="4">&nbsp;<a href="#23"><abbr title="foo()">foo</abbr></a></td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>
<td class=" small">1</td>
<td class=" big"></td>
<td class=" small"><div align="right">n/a</div></td>
<td class=" small"><div align="right">0&nbsp;/&nbsp;0</div></td>