Skip to content

Commit ee4b378

Browse files
author
Bastian Schwarz
committed
Resolve risky truth test
1 parent 0457f4b commit ee4b378

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Task/AbstractCrontabCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ public function __construct(
4747
*/
4848
final public function getOptionsWithUser() : array {
4949
$options = $this instanceof HasOptionsInterface ? $this->getOptions() : [];
50-
!$this->user ?: $options[] = "-u $this->user";
50+
(string) $this->user !== '' && $options[] = "-u $this->user";
5151
return $options;
5252
}
5353

5454
final public function __invoke() : void {
5555
$output = $this->commandRunner->run($this->crontabCommandFactory->build($this->getOptionsWithUser()));
5656
!$this instanceof HasOutputInteface ?: $this->writeln->writeln(PHP_EOL . $output);
5757
}
58-
}
58+
}

0 commit comments

Comments
 (0)