Skip to content

Commit a760b9c

Browse files
committed
refactor: remove reviewer property and use codeOwnerEmail default
1 parent 5a59719 commit a760b9c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Commands/InitCommand.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ class InitCommand extends Command implements Isolatable
6969

7070
protected string $appName;
7171

72-
protected ?string $reviewer = null;
73-
7472
public function handle(): void
7573
{
7674
$this->prepareAppName();
@@ -461,8 +459,8 @@ protected function prepareAppName(): void
461459

462460
protected function saveRenovateJSON(): void
463461
{
464-
$this->reviewer = $this->validateInput(
465-
method: fn () => $this->ask('Please type username of the project reviewer', Str::before($this->reviewer, '@')),
462+
$reviewer = $this->validateInput(
463+
method: fn () => $this->ask('Please type username of the project reviewer', Str::before($this->codeOwnerEmail, '@')),
466464
field: 'username of the project reviewer',
467465
rules: 'required|alpha_dash',
468466
);
@@ -471,7 +469,7 @@ protected function saveRenovateJSON(): void
471469
'$schema' => 'https://docs.renovatebot.com/renovate-schema.json',
472470
'extends' => ['config:recommended'],
473471
'enabledManagers' => ['composer'],
474-
'assignees' => [$this->reviewer],
472+
'assignees' => [$reviewer],
475473
];
476474

477475
file_put_contents('renovate.json', json_encode($data, JSON_PRETTY_PRINT));

0 commit comments

Comments
 (0)