Skip to content

Commit

Permalink
TASK: Fix phpstan error
Browse files Browse the repository at this point in the history
  • Loading branch information
sabbelasichon committed May 24, 2023
1 parent 343835f commit 8b426c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,3 @@ parameters:
message: "#^Instantiated class ProjectServiceContainer not found\\.$#"
count: 1
path: src/Cli/Symfony/ConsoleKernel.php

-
message: "#^Parameter \\#2 \\$node of method TYPO3\\\\Surf\\\\Domain\\\\Service\\\\ShellCommandService\\:\\:executeOrSimulate\\(\\) expects TYPO3\\\\Surf\\\\Domain\\\\Model\\\\Node, TYPO3\\\\Surf\\\\Domain\\\\Model\\\\Node\\|null given\\.$#"
count: 1
path: src/Task/TYPO3/CMS/AbstractCliTask.php
6 changes: 5 additions & 1 deletion src/Task/TYPO3/CMS/AbstractCliTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected function executeCliCommand(array $cliArguments, Node $node, CMS $appli
}
$commandPrefix .= $phpBinaryPathAndFilename . ' ';

if (!$this->targetNode instanceof Node) {
if ($this->targetNode === null) {
return false;
}

Expand Down Expand Up @@ -121,6 +121,10 @@ protected function fileExists(string $pathAndFileName, Node $node, CMS $applicat
$this->determineWorkingDirectoryAndTargetNode($node, $application, $deployment, $options);
$pathAndFileName = $this->workingDirectory . '/' . $pathAndFileName;

if ($this->targetNode === null) {
return false;
}

return $this->shell->executeOrSimulate('test -f ' . escapeshellarg($pathAndFileName), $this->targetNode, $deployment, true) !== false;
}
}

0 comments on commit 8b426c7

Please sign in to comment.