Skip to content

Commit 585fb47

Browse files
committed
Fix: cannot assign a value to a public readonly property outside of the constructor
1 parent 7ebe7f9 commit 585fb47

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/ChildProcess.php

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77

88
class ChildProcess implements ChildProcessContract
99
{
10-
public readonly int $pid;
10+
public int $pid;
1111

12-
public readonly string $alias;
12+
public string $alias;
1313

14-
public readonly array $cmd;
14+
public array $cmd;
1515

16-
public readonly ?string $cwd;
16+
public ?string $cwd;
1717

18-
public readonly ?array $env;
18+
public ?array $env;
1919

20-
public readonly bool $persistent;
20+
public bool $persistent;
2121

2222
final public function __construct(protected Client $client) {}
2323

@@ -54,7 +54,6 @@ public function all(): array
5454

5555
/**
5656
* @param string|string[] $cmd
57-
* @return $this
5857
*/
5958
public function start(
6059
string|array $cmd,
@@ -78,16 +77,15 @@ public function start(
7877

7978
/**
8079
* @param string|string[] $cmd
81-
* @return $this
8280
*/
83-
public function php(string|array $cmd, string $alias, ?array $env = null, ?bool $persistent = false): self
81+
public function php(string|array $cmd, string $alias, ?array $env = null, ?bool $persistent = false): static
8482
{
8583
$cmd = is_array($cmd) ? array_values($cmd) : [$cmd];
8684

8785
$process = $this->client->post('child-process/start-php', [
8886
'alias' => $alias,
8987
'cmd' => $cmd,
90-
'cwd' => $cwd ?? base_path(),
88+
'cwd' => base_path(),
9189
'env' => $env,
9290
'persistent' => $persistent,
9391
])->json();
@@ -97,9 +95,8 @@ public function php(string|array $cmd, string $alias, ?array $env = null, ?bool
9795

9896
/**
9997
* @param string|string[] $cmd
100-
* @return $this
10198
*/
102-
public function artisan(string|array $cmd, string $alias, ?array $env = null, ?bool $persistent = false): self
99+
public function artisan(string|array $cmd, string $alias, ?array $env = null, ?bool $persistent = false): static
103100
{
104101
$cmd = is_array($cmd) ? array_values($cmd) : [$cmd];
105102

0 commit comments

Comments
 (0)