diff --git a/Makefile b/Makefile index 173c589..9d58f03 100644 --- a/Makefile +++ b/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: diff --git a/src/App.php b/src/App.php index f365e15..b92a251 100644 --- a/src/App.php +++ b/src/App.php @@ -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"); diff --git a/src/CommandBackup.php b/src/CommandBackup.php index c26a7e1..ac47735 100644 --- a/src/CommandBackup.php +++ b/src/CommandBackup.php @@ -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); diff --git a/src/Rclone/Rclone.php b/src/Rclone/Rclone.php index b22274c..c459756 100644 --- a/src/Rclone/Rclone.php +++ b/src/Rclone/Rclone.php @@ -10,7 +10,7 @@ use Symfony\Component\Process\Exception\ProcessFailedException; use Exception; -class Rclone +class Rclone { use LoggerAwareTrait; @@ -70,8 +70,12 @@ class Rclone } /** - * @param $command Top level Rclone command - * @param array $options + * Execute a command on the rclone binary + * + * @param string $command Top level Rclone command + * @param array $options Array of additional options + * + * @return string stdout data. */ protected function exec(string $command, array $options = array()) : string { diff --git a/src/Twig/AppExtension.php b/src/Twig/AppExtension.php index 045aaa2..2da3a95 100644 --- a/src/Twig/AppExtension.php +++ b/src/Twig/AppExtension.php @@ -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 + * @param int $precision Precision + * * @return string Formatted string */ public function formatBytes($bytes, $precision = 2)