diff --git a/lib/BackgroundJobs/Launcher.php b/lib/BackgroundJobs/Launcher.php index 1a20e0c..7930bbd 100644 --- a/lib/BackgroundJobs/Launcher.php +++ b/lib/BackgroundJobs/Launcher.php @@ -59,7 +59,7 @@ protected function run($argument): void { $command = str_replace('%f', escapeshellarg($tmpFile), $command); } - // with wrapping sh around the the command, we leave any redirects in tact, + // with wrapping sh around the command, we leave any redirects intact, // but ensure that the script is not blocking Nextcloud's execution $wrapper = 'sh -c ' . escapeshellarg($command) . ' >/dev/null &'; $this->logger->info( diff --git a/lib/Operation.php b/lib/Operation.php index 7d4cd49..b86c445 100644 --- a/lib/Operation.php +++ b/lib/Operation.php @@ -172,7 +172,7 @@ public function onEvent(string $eventName, Event $event, IRuleMatcher $ruleMatch } $this->jobList->add(Launcher::class, $args); } - } catch (NotFoundException $e) { + } catch (NotFoundException) { } } @@ -199,11 +199,11 @@ protected function buildCommand(string $template, Node $node, string $event, arr if ($node instanceof FileNode) { $fullPath = $view->getLocalFile($node->getPath()); } - if ($fullPath === null) { + if (!isset($fullPath) || $fullPath === false) { throw new InvalidArgumentException(); } $command = str_replace('%f', escapeshellarg($fullPath), $command); - } catch (Exception $e) { + } catch (Exception) { throw new InvalidArgumentException('Could not determine full path'); } } @@ -212,7 +212,7 @@ protected function buildCommand(string $template, Node $node, string $event, arr $nodeID = -1; try { $nodeID = $node->getId(); - } catch (InvalidPathException | NotFoundException $e) { + } catch (InvalidPathException | NotFoundException) { } $command = str_replace('%i', escapeshellarg((string)$nodeID), $command); }