for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace phpbu\App\Log\ResultFormatter;
use phpbu\App\Result;
/**
* ResultFormatter base class
*
* @package phpbu
* @subpackage Log
* @author Sebastian Feldmann <[email protected]>
* @copyright Sebastian Feldmann <[email protected]>
* @license https://opensource.org/licenses/MIT The MIT License (MIT)
* @link https://phpbu.de/
* @since Class available since Release 5.0.0
*/
abstract class Abstraction
{
* Returns summary data.
* @param \phpbu\App\Result $result
* @return array
public function getSummaryData(Result $result) : array
$start = $result->started();
$end = microtime(true);
return [
'status' => $result->allOk() ? 0 : 1,
'timestamp' => (int) $start,
'duration' => round($end - $start, 4),
'backupCount' => count($result->getBackups()),
'backupFailed' => $result->backupsFailedCount(),
'errorCount' => $result->errorCount(),
];
}