Skip to content

Commit

Permalink
[BUGFIX] Fix setting depth=0
Browse files Browse the repository at this point in the history
If a depth=0 is set via the CLI command brofix:checklinks,
it is interpreted as unset option and the default is used.

Resolves: #69
  • Loading branch information
sypets committed Jun 24, 2021
1 parent ecf21e1 commit 6705586
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 10 additions & 1 deletion Classes/Command/CheckLinksCommand.php
Expand Up @@ -179,7 +179,16 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return 1;
}

$this->depth = (int)($input->getOption('depth') ?: -1);
/**
* @var string|null $depthOption
*/
$depthOption = $input->getOption('depth');
if ($depthOption !== null) {
$this->depth = (int)($depthOption);
} else {
$this->depth = -1;
}

$this->sendTo = $input->getOption('to') ?: '';

foreach ($startPages as $pageId) {
Expand Down
5 changes: 4 additions & 1 deletion Documentation/Changelog/Index.rst
Expand Up @@ -9,9 +9,12 @@ Changelog
2.1.1
=====

* Fix version constraints (in ext_emconf.php)
* Fix setting of depth=0 via CLI command brofix:checklinks
(issue:`69 <https://github.com/sypets/brofix/issues/69>`__)
* Fix fatal error: Exception was thrown on CLI command checklinks if
replytoemail was set (due to call to not existing function).
(issue:`68 <https://github.com/sypets/brofix/issues/68>`__)
* Fix version constraints (in ext_emconf.php)

2.1.0
=====
Expand Down

0 comments on commit 6705586

Please sign in to comment.