From 5cf6616793ddcb664ab2be6f57c62d4b8ff641ea Mon Sep 17 00:00:00 2001 From: "tan.nguyen" Date: Fri, 5 Jul 2024 09:50:02 +0700 Subject: [PATCH] Lint --- src/Commands/ArtifactCommand.php | 4 ++-- src/Traits/LogTrait.php | 1 + src/Traits/TokenTrait.php | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Commands/ArtifactCommand.php b/src/Commands/ArtifactCommand.php index 00f9494..84c0277 100644 --- a/src/Commands/ArtifactCommand.php +++ b/src/Commands/ArtifactCommand.php @@ -140,7 +140,7 @@ class ArtifactCommand extends Command { public function __construct( ArtifactGit $gitWrapper = NULL, Filesystem $fsFileSystem = NULL, - ?string $name = NULL + ?string $name = NULL, ) { parent::__construct($name); $this->fsFileSystem = is_null($fsFileSystem) ? new Filesystem() : $fsFileSystem; @@ -760,7 +760,7 @@ protected function localExcludeEmpty(string $path, bool $strict = FALSE): bool { } $lines = file($filename); if ($lines) { - $lines = array_map('trim', $lines); + $lines = array_map(trim(...), $lines); $lines = array_filter($lines, static function ($line) : bool { return strlen($line) > 0; }); diff --git a/src/Traits/LogTrait.php b/src/Traits/LogTrait.php index 0ef34d2..477551e 100644 --- a/src/Traits/LogTrait.php +++ b/src/Traits/LogTrait.php @@ -49,6 +49,7 @@ public static function createLogger(string $name, OutputInterface $output, strin OutputInterface::VERBOSITY_DEBUG => Level::Debug, ]; $verbosity = $output->getVerbosity(); + // @phpstan-ignore-next-line $level = $verbosityMapping[$verbosity] ?? Level::Debug; $handler = new StreamHandler($logFile, $level); $logger->pushHandler($handler); diff --git a/src/Traits/TokenTrait.php b/src/Traits/TokenTrait.php index 29376bc..98e7911 100644 --- a/src/Traits/TokenTrait.php +++ b/src/Traits/TokenTrait.php @@ -20,6 +20,7 @@ trait TokenTrait { * original string. */ protected function tokenProcess(string $string): ?string { + /* @phpstan-ignore-next-line */ return preg_replace_callback('/(?:\[([^\]]+)\])/', function (array $match) { if (count($match) > 1) { $parts = explode(':', $match[1], 2);