Skip to content

Commit

Permalink
Use inline constructors.
Browse files Browse the repository at this point in the history
Save on a few lines of code with inline constructors.
  • Loading branch information
markstory committed Aug 31, 2013
1 parent 5819e20 commit 3cc489e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions App/Config/bootstrap.php
Expand Up @@ -56,8 +56,7 @@
* that changes from configuration that does not. This makes deployment simpler.
*/
try {
$reader = new PhpConfig();
Configure::config('default', $reader);
Configure::config('default', new PhpConfig());
Configure::load('app.php', 'default', false);
} catch (\Exception $e) {
die('Unable to load Config/app.php ensure it exists.');
Expand Down Expand Up @@ -88,12 +87,10 @@
* Register application error and exception handlers.
*/
if (php_sapi_name() == 'cli') {
$errorHandler = new ConsoleErrorHandler(Configure::consume('Error'));
(new ConsoleErrorHandler(Configure::consume('Error')))->register();
} else {
$errorHandler = new ErrorHandler(Configure::consume('Error'));
(new ErrorHandler(Configure::consume('Error')))->register();
}
$errorHandler->register();
unset($errorHandler);


/**
Expand Down

0 comments on commit 3cc489e

Please sign in to comment.