1
0
mirror of https://github.com/flarum/core.git synced 2025-07-29 20:50:28 +02:00

Cleanup code from #1876

- Extract a method for email address generation
- Consistent types
- No docblocks for types where superfluous
- Tweak console output
- Don't inherit from integration test's base class in unit test
This commit is contained in:
Franz Liedke
2019-09-24 01:00:22 +02:00
parent 738ca405fe
commit 3417c0cbee
6 changed files with 66 additions and 51 deletions

View File

@@ -55,16 +55,16 @@ class InstallController implements RequestHandlerInterface
public function handle(Request $request): ResponseInterface
{
$input = $request->getParsedBody();
$baseUrl = $request->getUri();
$baseUrl = BaseUrl::fromUri($request->getUri());
try {
$pipeline = $this->installation
->baseUrl(BaseUrl::fromUri($baseUrl))
->baseUrl($baseUrl)
->databaseConfig($this->makeDatabaseConfig($input))
->adminUser($this->makeAdminUser($input))
->settings([
'forum_title' => Arr::get($input, 'forumTitle'),
'mail_from' => 'noreply@'.preg_replace('/^www\./i', '', $baseUrl->getHost()),
'mail_from' => $baseUrl->toEmail('noreply'),
'welcome_title' => 'Welcome to '.Arr::get($input, 'forumTitle'),
])
->build();