Skip to content

Commit 0fe6230

Browse files
committed
fix: remarks from reviewer
1 parent bbf1fa4 commit 0fe6230

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/Commands/InitCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public function handle(): void
183183
}
184184

185185
if ($shouldGenerateReadme = $this->confirm('Do you want to generate a README file?', true)) {
186-
$this->readmeGenerator->generate($this->appName, $this->appType->value);
186+
$this->readmeGenerator->generate($this->appName, $this->appType->value, $this->appUrl);
187187

188188
if ($this->confirm('Do you need a `Resources & Contacts` part?', true)) {
189189
$this->readmeGenerator->fillResourcesAndContacts();
@@ -200,14 +200,14 @@ public function handle(): void
200200
}
201201

202202
if ($this->confirm('Do you need an `Environments` part?', true)) {
203-
$this->readmeGenerator->fillEnvironments($this->appUrl);
203+
$this->readmeGenerator->fillEnvironments();
204204
}
205205

206206
if ($this->confirm('Do you need a `Credentials and Access` part?', true)) {
207207
$this->fillCredentialsAndAccess($kebabName);
208208

209209
if ($this->authType === AuthTypeEnum::Clerk) {
210-
$this->readmeGenerator->fillClerkAuthType();
210+
$this->readmeGenerator->fillClerkAuth();
211211
}
212212
}
213213
}

src/Generators/ReadmeGenerator.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ class ReadmeGenerator
88

99
protected string $content = '';
1010

11-
public function generate(string $appName, string $appType): void
11+
protected string $appUrl;
12+
13+
public function generate(string $appName, string $appType, string $appUrl): void
1214
{
15+
$this->appUrl = $appUrl;
16+
1317
$file = $this->loadReadmePart('README.md');
1418

1519
$this->setReadmeValue($file, 'project_name', $appName);
@@ -33,15 +37,15 @@ public function fillPrerequisites(): void
3337
$this->updateReadmeFile($filePart);
3438
}
3539

36-
public function fillEnvironments(string $appUrl): void
40+
public function fillEnvironments(): void
3741
{
3842
$filePart = $this->loadReadmePart('ENVIRONMENTS.md');
3943

40-
$this->setReadmeValue($filePart, 'api_link', $appUrl);
44+
$this->setReadmeValue($filePart, 'api_link', $this->appUrl);
4145
$this->updateReadmeFile($filePart);
4246
}
4347

44-
public function fillClerkAuthType(): void
48+
public function fillClerkAuth(): void
4549
{
4650
$filePart = $this->loadReadmePart('CLERK.md');
4751

0 commit comments

Comments
 (0)