PHP_CodeSniffer performed.
This commit is contained in:
2
Makefile
2
Makefile
@ -5,6 +5,8 @@ analyze-all:
|
||||
-./vendor/bin/phpstan analyze --level=7 src/ backup
|
||||
@echo Psalm
|
||||
-./vendor/bin/psalm
|
||||
@echo PHP_CodeSniffer
|
||||
-./vendor/bin/phpcs src
|
||||
install:
|
||||
php composer.phar install --no-dev
|
||||
install-dev:
|
||||
|
@ -8,7 +8,8 @@ use Monolog\Logger;
|
||||
use Monolog\Handler\StreamHandler;
|
||||
use Psr\Log\NullLogger;
|
||||
|
||||
class App {
|
||||
class App
|
||||
{
|
||||
protected Logger $logger;
|
||||
protected array $config;
|
||||
|
||||
@ -16,7 +17,7 @@ class App {
|
||||
{
|
||||
$this->config = Yaml::parseFile($configFile);
|
||||
$logger = new Logger('app');
|
||||
if(isset($this->config['log'])) {
|
||||
if (isset($this->config['log'])) {
|
||||
$logger->pushHandler(new StreamHandler($this->getConfig()['log']));
|
||||
}
|
||||
$logger->info("Initialization complete");
|
||||
|
@ -41,7 +41,7 @@ class CommandBackup extends Command
|
||||
$rclone->setLogger($app->getLogger()->withName('rclone'));
|
||||
|
||||
$ntfy = new Ntfy\Ntfy($app->getConfig()['notification']['domain']);
|
||||
$ntfy->setLogger( $app->getLogger()->withName('notification'));
|
||||
$ntfy->setLogger($app->getLogger()->withName('notification'));
|
||||
|
||||
$loader = new ArrayLoader($app->getConfig()['templates']);
|
||||
$twig = new Environment($loader);
|
||||
|
@ -70,8 +70,12 @@ class Rclone
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $command Top level Rclone command
|
||||
* @param array<String> $options
|
||||
* Execute a command on the rclone binary
|
||||
*
|
||||
* @param string $command Top level Rclone command
|
||||
* @param array<String> $options Array of additional options
|
||||
*
|
||||
* @return string stdout data.
|
||||
*/
|
||||
protected function exec(string $command, array $options = array()) : string
|
||||
{
|
||||
|
@ -17,8 +17,10 @@ class AppExtension extends AbstractExtension
|
||||
|
||||
/**
|
||||
* Format a file size to be human readable
|
||||
*
|
||||
* @param int $bytes Number of bytes
|
||||
* @param int $precision Precision
|
||||
*
|
||||
* @return string Formatted string
|
||||
*/
|
||||
public function formatBytes($bytes, $precision = 2)
|
||||
|
Reference in New Issue
Block a user