Skip to content

Commit 48fcebe

Browse files
committed
Fix CS errors
1 parent 89d6e6d commit 48fcebe

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

config/bootstrap.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
use Cake\Cache\Cache;
3636
use Cake\Core\Configure;
3737
use Cake\Core\Configure\Engine\PhpConfig;
38+
use Cake\Core\Exception\CakeException;
3839
use Cake\Datasource\ConnectionManager;
3940
use Cake\Error\ErrorTrap;
4041
use Cake\Error\ExceptionTrap;
@@ -44,6 +45,7 @@
4445
use Cake\Mailer\TransportFactory;
4546
use Cake\Routing\Router;
4647
use Cake\Utility\Security;
48+
use Detection\MobileDetect;
4749
use function Cake\Core\env;
4850

4951
/*
@@ -83,7 +85,7 @@
8385
try {
8486
Configure::config('default', new PhpConfig());
8587
Configure::load('app', 'default', false);
86-
} catch (\Exception $e) {
88+
} catch (Exception $e) {
8789
exit($e->getMessage() . "\n");
8890
}
8991

@@ -165,10 +167,10 @@
165167
* This allows CLI tools (like PHPStan) to load the bootstrap without throwing.
166168
*/
167169
if (!Configure::read('debug') && $httpHost) {
168-
throw new \Cake\Core\Exception\CakeException(
170+
throw new CakeException(
169171
'SECURITY: App.fullBaseUrl is not configured. ' .
170172
'This is required in production to prevent Host Header Injection attacks. ' .
171-
'Set APP_FULL_BASE_URL environment variable or configure App.fullBaseUrl in config/app.php'
173+
'Set APP_FULL_BASE_URL environment variable or configure App.fullBaseUrl in config/app.php',
172174
);
173175
}
174176

@@ -207,12 +209,12 @@
207209
* and the mobiledetect package from composer.json.
208210
*/
209211
ServerRequest::addDetector('mobile', function ($request) {
210-
$detector = new \Detection\MobileDetect();
212+
$detector = new MobileDetect();
211213

212214
return $detector->isMobile();
213215
});
214216
ServerRequest::addDetector('tablet', function ($request) {
215-
$detector = new \Detection\MobileDetect();
217+
$detector = new MobileDetect();
216218

217219
return $detector->isTablet();
218220
});

0 commit comments

Comments
 (0)