Skip to content

Commit 507e94b

Browse files
authored
Merge pull request #59 from seregazhuk/use-const-for-php-binary
Use predefined const for PHP binary
2 parents ece1b45 + a1e966c commit 507e94b

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/Config/Config.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
final class Config
66
{
7-
private const DEFAULT_PHP_EXECUTABLE = 'php';
87
private const DEFAULT_DELAY_IN_SECONDS = 0.25;
98
private const DEFAULT_SIGNAL = SIGINT;
109

@@ -28,7 +27,7 @@ final class Config
2827
public function __construct(?string $script, ?string $phpExecutable, ?int $signal, ?float $delay, array $arguments, bool $spinnerDisabled, WatchList $watchList)
2928
{
3029
$this->script = $script;
31-
$this->phpExecutable = $phpExecutable ?: self::DEFAULT_PHP_EXECUTABLE;
30+
$this->phpExecutable = $phpExecutable ?: PHP_BINARY;
3231
$this->signal = $signal ?: self::DEFAULT_SIGNAL;
3332
$this->delay = $delay ?: self::DEFAULT_DELAY_IN_SECONDS;
3433
$this->arguments = $arguments;
@@ -88,7 +87,7 @@ public function merge(self $another): self
8887
{
8988
return new self(
9089
empty($this->script) && $another->script ? $another->script : $this->script,
91-
$this->phpExecutable === self::DEFAULT_PHP_EXECUTABLE && $another->phpExecutable ? $another->phpExecutable: $this->phpExecutable,
90+
$this->phpExecutable === PHP_BINARY && $another->phpExecutable ? $another->phpExecutable: $this->phpExecutable,
9291
$this->signal === self::DEFAULT_SIGNAL && $another->signal ? $another->signal : $this->signal,
9392
$this->delay === self::DEFAULT_DELAY_IN_SECONDS && $another->delay ? $another->delay: $this->delay,
9493
empty($this->arguments) && !empty($another->arguments) ? $another->arguments : $this->arguments,

src/Screen/Screen.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private function warning(string $text): void
6262

6363
public function start(string $command): void
6464
{
65-
$command = str_replace('exec', '', $command);
65+
$command = str_replace(['exec', PHP_BINARY], ['', 'php'], $command);
6666
$this->info(sprintf('starting `%s`', trim($command)));
6767
}
6868

0 commit comments

Comments
 (0)