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

@@ -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();
}