Skip to content

Commit 45e9408

Browse files
Update dependency phpstan/phpstan to ^2.1.41 (#277)
* Update dependency phpstan/phpstan to ^2.1.41 * Fixed coding standards after dependency update. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Alex Skrypnyk <alex@drevops.com>
1 parent 4630525 commit 45e9408

3 files changed

Lines changed: 13 additions & 13 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"drevops/phpcs-standard": "^0.7.0",
3131
"drupal/coder": "^8.3.31",
3232
"ergebnis/composer-normalize": "^2.50.0",
33-
"phpstan/phpstan": "^2.1.40",
33+
"phpstan/phpstan": "^2.1.41",
3434
"phpunit/phpunit": "^11.5.55",
3535
"pyrech/composer-changelogs": "^2.2",
3636
"rector/rector": "^2.3.9"

composer.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Commands/ArtifactCommand.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -332,17 +332,17 @@ protected function resolveOptions(string $url, array $options): void {
332332
}
333333

334334
$this->remoteUrl = $url;
335-
$this->now = empty($options['now']) ? time() : (int) $options['now'];
335+
$this->now = empty($options['now']) ? time() : (is_scalar($options['now']) ? (int) $options['now'] : time());
336336
$this->remoteName = sprintf('%s-%s-%s', self::GIT_REMOTE_NAME, $this->now, rand(1000, 9999));
337337
$this->showChanges = !empty($options['show-changes']);
338338
$this->needCleanup = empty($options['no-cleanup']);
339339
$this->isDryRun = !empty($options['dry-run']);
340340
$this->failOnMissingBranch = !empty($options['fail-on-missing-branch']);
341-
$this->logFile = empty($options['log']) ? '' : $this->fsGetAbsolutePath($options['log']);
341+
$this->logFile = empty($options['log']) || !is_string($options['log']) ? '' : $this->fsGetAbsolutePath($options['log']);
342342

343-
$this->setMode($options['mode'], $options);
343+
$this->setMode(is_string($options['mode']) ? $options['mode'] : '', $options);
344344

345-
$this->sourceDir = empty($options['src']) ? $this->fsGetRootDir() : $this->fsGetAbsolutePath($options['src']);
345+
$this->sourceDir = empty($options['src']) || !is_string($options['src']) ? $this->fsGetRootDir() : $this->fsGetAbsolutePath($options['src']);
346346

347347
// Setup Git repository from source path.
348348
$this->repo = new ArtifactGitRepository($this->sourceDir, NULL, $this->logger);
@@ -371,17 +371,17 @@ protected function resolveOptions(string $url, array $options): void {
371371
return;
372372
}
373373

374-
$branch = $this->tokenProcess($options['branch']);
374+
$branch = $this->tokenProcess(is_string($options['branch']) ? $options['branch'] : '');
375375
if (!ArtifactGitRepository::isValidBranchName($branch)) {
376376
throw new \RuntimeException(sprintf('Incorrect value "%s" specified for git remote branch', $branch));
377377
}
378378
$this->destinationBranch = $branch;
379379

380380
$this->artifactBranch = $this->destinationBranch . '-artifact';
381381

382-
$this->commitMessage = $this->tokenProcess($options['message']);
382+
$this->commitMessage = $this->tokenProcess(is_string($options['message']) ? $options['message'] : '');
383383

384-
if (!empty($options['gitignore'])) {
384+
if (!empty($options['gitignore']) && is_string($options['gitignore'])) {
385385
$gitignore = $this->fsGetAbsolutePath($options['gitignore']);
386386
$this->fsAssertPathsExist($gitignore);
387387

0 commit comments

Comments
 (0)