Skip to content
Permalink
Browse files

Some changes in Scrutinizer config + fixes

  • Loading branch information...
Vitaly Baev
Vitaly Baev committed May 9, 2018
1 parent 2c5f1bb commit ec3fba89a6e58eb874c5c718b3df4997bfc42222
@@ -5,5 +5,7 @@ coding_style:
spaces:
around_operators:
concatenation: true
ternary_operator:
in_short_version: false
other:
after_type_cast: true
@@ -112,7 +112,7 @@ public function getSuffix() : string
*/
protected function createExecutable(Target $target) : Executable
{
$executable = new Executable\Mcrypt((string)$this->pathToMcrypt);
$executable = new Executable\Mcrypt((string) $this->pathToMcrypt);
$executable->useAlgorithm($this->algorithm)
->useKey($this->key)
->useKeyFile($this->keyFile)
@@ -35,7 +35,7 @@ public function __construct($container, $object)
$this->container = $container;
$this->filename = basename($object->name);
$this->pathname = $object->name;
$this->size = (int)$object->contentLength;
$this->size = (int) $object->contentLength;
$this->lastModified = $object->lastModified->getTimestamp();
}
@@ -87,7 +87,7 @@ protected function getProtocolName()
public function sync(Target $target, Result $result)
{
// silence ftp errors
$old = error_reporting(0);
$old = error_reporting(0);
if (!$this->ftpConnection = ftp_connect($this->host)) {
throw new Exception(
sprintf(
@@ -56,7 +56,7 @@ public static function create($name)
public static function getClassName($name)
{
if (!isset(self::$availableCompressors[$name])) {
throw new Exception('Invalid compressor: ' .$name);
throw new Exception('Invalid compressor: ' . $name);
}
$class = self::$availableCompressors[$name];
return '\\phpbu\\App\\Backup\\Target\\Compression\\' . $class;
@@ -183,15 +183,15 @@ public function setup(array $options)
*/
public function onPhpbuEnd(Event\App\End $event)
{
$result = $event->getResult();
$result = $event->getResult();
if ($this->shouldMailBeSend($result)) {
$header = $this->getHeaderHtml();
$status = $this->getStatusHtml($result);
$errors = $this->getErrorHtml($result);
$info = $this->getInfoHtml($result);
$footer = $this->getFooterHtml();
$body = '<html><body '. TPL::getSnippet('sBody') . '>'
$body = '<html><body ' . TPL::getSnippet('sBody') . '>'
. $header
. $status
. $errors
@@ -410,7 +410,7 @@ protected function getStatusHtml(Result $result)
$this->numCleanups,
Str::appendPluralS('cleanup', $this->numCleanups)
);
$html = '<table ' . sprintf(TPL::getSnippet('sTableStatus'), $color) .'>' .
$html = '<table ' . sprintf(TPL::getSnippet('sTableStatus'), $color) . '>' .
'<tr><td>' .
'<span ' . TPL::getSnippet('sTableStatusText') . '>' . date('Y-m-d H:i') . '</span>' .
'<h1 ' . TPL::getSnippet('sTableStatusHead') . '>' . $status . '</h1>' .
@@ -478,7 +478,7 @@ protected function getInfoHtml(Result $result)
$html .= '<tr>' .
'<td ' . sprintf(TPL::getSnippet('sTableBackupStatusColumn'), $color) . ' colspan="4">' .
sprintf('backup <em>%s</em>', $backup->getName()) .
' <span ' . TPL::getSnippet('sTableBackupStatusText') . '>' . $status .'</span>'.
' <span ' . TPL::getSnippet('sTableBackupStatusText') . '>' . $status . '</span>'.
'</td>' .
'</tr>' .
'<tr>' .
@@ -133,7 +133,7 @@ private function renderErrors(string $errorTpl, array $errors) : string
$markup = '';
/* @var $e \Exception */
foreach ($errors as $e) {
$data = [
$data = [
'class' => get_class($e),
'message' => $e->getMessage(),
'file' => $e->getFile(),
@@ -156,7 +156,7 @@ private function renderBackups(string $backupTpl, array $backups) : string
$markup = '';
/* @var $b \phpbu\App\Result\Backup */
foreach ($backups as $b) {
$data = [
$data = [
'name' => $b->getName(),
'status' => $b->allOk() ? 0 : 1,
'checkCount' => $b->checkCount(),

0 comments on commit ec3fba8

Please sign in to comment.
You can’t perform that action at this time.