Skip to content

Commit

Permalink
refactor: Go ternary
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Jul 1, 2024
1 parent 35c8cd5 commit c3719ec
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/web/SandboxView.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ class SandboxView extends View
public function init(): void
{
parent::init();
if (Craft::$app->getRequest()->getIsConsoleRequest()) {
$this->sandboxErrorHandler = new ConsoleSandboxErrorHandler();
} else {
$this->sandboxErrorHandler = new WebSandboxErrorHandler();
}
$this->sandboxErrorHandler = Craft::$app->getRequest()->getIsConsoleRequest() ? new ConsoleSandboxErrorHandler() : new WebSandboxErrorHandler();
// Use the passed in SecurityPolicy, or create a default security policy
$this->securityPolicy = $this->securityPolicy ?? new WhitelistSecurityPolicy();
}
Expand Down

0 comments on commit c3719ec

Please sign in to comment.