Skip to content

Commit f3c147d

Browse files
committed
Applied latest styleci changes
1 parent 747f81d commit f3c147d

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

app/Exceptions/WhoopsBookStackPrettyHandler.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
class WhoopsBookStackPrettyHandler extends Handler
88
{
9-
109
/**
1110
* @return int|null A handler may return nothing, or a Handler::HANDLE_* constant
1211
*/
@@ -15,16 +14,17 @@ public function handle()
1514
$exception = $this->getException();
1615

1716
echo view('errors.debug', [
18-
'error' => $exception->getMessage(),
19-
'errorClass' => get_class($exception),
20-
'trace' => $exception->getTraceAsString(),
17+
'error' => $exception->getMessage(),
18+
'errorClass' => get_class($exception),
19+
'trace' => $exception->getTraceAsString(),
2120
'environment' => $this->getEnvironment(),
2221
])->render();
2322

2423
return Handler::QUIT;
2524
}
2625

27-
protected function safeReturn(callable $callback, $default = null) {
26+
protected function safeReturn(callable $callback, $default = null)
27+
{
2828
try {
2929
return $callback();
3030
} catch (\Exception $e) {
@@ -35,14 +35,15 @@ protected function safeReturn(callable $callback, $default = null) {
3535
protected function getEnvironment(): array
3636
{
3737
return [
38-
'PHP Version' => phpversion(),
39-
'BookStack Version' => $this->safeReturn(function() {
38+
'PHP Version' => phpversion(),
39+
'BookStack Version' => $this->safeReturn(function () {
4040
$versionFile = base_path('version');
41+
4142
return trim(file_get_contents($versionFile));
4243
}, 'unknown'),
43-
'Theme Configured' => $this->safeReturn(function() {
44-
return config('view.theme');
45-
}) ?? 'None',
44+
'Theme Configured' => $this->safeReturn(function () {
45+
return config('view.theme');
46+
}) ?? 'None',
4647
];
4748
}
48-
}
49+
}

app/Providers/AppServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function boot()
6767
*/
6868
public function register()
6969
{
70-
$this->app->bind(HandlerInterface::class, function($app) {
70+
$this->app->bind(HandlerInterface::class, function ($app) {
7171
return $app->make(WhoopsBookStackPrettyHandler::class);
7272
});
7373

tests/Auth/MfaConfigurationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public function test_totp_setup_url_shows_correct_user_when_setup_forced_upon_lo
180180

181181
$resp = $this->get('/mfa/totp/generate');
182182
$resp->assertSeeText('Mobile App Setup');
183-
$resp->assertDontSee("otpauth://totp/BookStack:guest%40example.com");
184-
$resp->assertSee("otpauth://totp/BookStack:admin%40admin.com");
183+
$resp->assertDontSee('otpauth://totp/BookStack:guest%40example.com');
184+
$resp->assertSee('otpauth://totp/BookStack:admin%40admin.com');
185185
}
186186
}

tests/DebugViewTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,12 @@ public function test_debug_view_only_shows_when_debug_mode_is_enabled()
4242
$resp->assertSeeText('An unknown error occurred');
4343
}
4444

45-
4645
protected function getDebugViewForException(\Exception $exception): TestResponse
4746
{
4847
// Fake an error via social auth service used on login page
4948
$mockService = $this->mock(SocialAuthService::class);
5049
$mockService->shouldReceive('getActiveDrivers')->andThrow($exception);
50+
5151
return $this->get('/login');
5252
}
53-
54-
}
53+
}

0 commit comments

Comments
 (0)