From c5a124afe1ece789e66f57945be8d046d1b22212 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Mon, 20 Jun 2016 10:18:38 -0400 Subject: [PATCH] Applied fixes from StyleCI --- .../BugsnagExceptionHandler.php | 12 +- src/Bugsnag/BugsnagLaravel/BugsnagFacade.php | 4 +- .../BugsnagLaravelServiceProvider.php | 18 +-- .../BugsnagLumenServiceProvider.php | 12 +- src/Bugsnag/BugsnagLaravel/config.php | 134 +++++++++--------- src/config/config.php | 134 +++++++++--------- 6 files changed, 161 insertions(+), 153 deletions(-) diff --git a/src/Bugsnag/BugsnagLaravel/BugsnagExceptionHandler.php b/src/Bugsnag/BugsnagLaravel/BugsnagExceptionHandler.php index 4031835b..354e2ac9 100644 --- a/src/Bugsnag/BugsnagLaravel/BugsnagExceptionHandler.php +++ b/src/Bugsnag/BugsnagLaravel/BugsnagExceptionHandler.php @@ -1,21 +1,25 @@ -shouldReport($e) && app()->bound('bugsnag')) { - app('bugsnag')->notifyException($e, null, "error"); + app('bugsnag')->notifyException($e, null, 'error'); } return parent::report($e); diff --git a/src/Bugsnag/BugsnagLaravel/BugsnagFacade.php b/src/Bugsnag/BugsnagLaravel/BugsnagFacade.php index 59a0f269..fc295c77 100644 --- a/src/Bugsnag/BugsnagLaravel/BugsnagFacade.php +++ b/src/Bugsnag/BugsnagLaravel/BugsnagFacade.php @@ -1,4 +1,6 @@ -app; if (version_compare($app::VERSION, '5.0') < 0) { - $this->package('bugsnag/bugsnag-laravel', 'bugsnag'); // Register for exception handling @@ -30,16 +30,16 @@ public function boot() if ('Symfony\Component\Debug\Exception\FatalErrorException' !== get_class($exception) ) { - $app['bugsnag']->notifyException($exception, null, "error"); + $app['bugsnag']->notifyException($exception, null, 'error'); } }); // Register for fatal error handling $app->fatal(function ($exception) use ($app) { - $app['bugsnag']->notifyException($exception, null, "error"); + $app['bugsnag']->notifyException($exception, null, 'error'); }); } else { - $this->publishes(array( + $this->publishes(array( __DIR__.'/config.php' => config_path('bugsnag.php'), ), 'config'); } @@ -65,9 +65,9 @@ public function register() $client->setBatchSending(false); $client->setReleaseStage($app->environment()); $client->setNotifier(array( - 'name' => 'Bugsnag Laravel', + 'name' => 'Bugsnag Laravel', 'version' => '1.6.4', - 'url' => 'https://github.com/bugsnag/bugsnag-laravel' + 'url' => 'https://github.com/bugsnag/bugsnag-laravel', )); if (isset($config['notify_release_stages']) && is_array($config['notify_release_stages'])) { @@ -110,6 +110,6 @@ public function register() */ public function provides() { - return array("bugsnag"); + return array('bugsnag'); } } diff --git a/src/Bugsnag/BugsnagLaravel/BugsnagLumenServiceProvider.php b/src/Bugsnag/BugsnagLaravel/BugsnagLumenServiceProvider.php index 2039e89e..ce689d7f 100644 --- a/src/Bugsnag/BugsnagLaravel/BugsnagLumenServiceProvider.php +++ b/src/Bugsnag/BugsnagLaravel/BugsnagLumenServiceProvider.php @@ -1,4 +1,6 @@ -setStripPath(base_path()); - $client->setProjectRoot(base_path() . '/app'); + $client->setProjectRoot(base_path().'/app'); $client->setAutoNotify(false); $client->setBatchSending(false); $client->setReleaseStage($app->environment()); $client->setNotifier(array( - 'name' => 'Bugsnag Lumen', + 'name' => 'Bugsnag Lumen', 'version' => '1.6.4', - 'url' => 'https://github.com/bugsnag/bugsnag-laravel' + 'url' => 'https://github.com/bugsnag/bugsnag-laravel', )); if (isset($config['notify_release_stages']) && is_array($config['notify_release_stages'])) { @@ -86,6 +88,6 @@ public function register() */ public function provides() { - return array("bugsnag"); + return array('bugsnag'); } } diff --git a/src/Bugsnag/BugsnagLaravel/config.php b/src/Bugsnag/BugsnagLaravel/config.php index f92af767..db1cdf8c 100644 --- a/src/Bugsnag/BugsnagLaravel/config.php +++ b/src/Bugsnag/BugsnagLaravel/config.php @@ -2,76 +2,76 @@ return array( - /* - |-------------------------------------------------------------------------- - | API Key - |-------------------------------------------------------------------------- - | - | You can find your API key on your Bugsnag dashboard. - | - | This api key points the Bugsnag notifier to the project in your account - | which should receive your application's uncaught exceptions. - | - */ - 'api_key' => env('BUGSNAG_API_KEY'), + /* + |-------------------------------------------------------------------------- + | API Key + |-------------------------------------------------------------------------- + | + | You can find your API key on your Bugsnag dashboard. + | + | This api key points the Bugsnag notifier to the project in your account + | which should receive your application's uncaught exceptions. + | + */ + 'api_key' => env('BUGSNAG_API_KEY'), - /* - |-------------------------------------------------------------------------- - | Notify Release Stages - |-------------------------------------------------------------------------- - | - | Set which release stages should send notifications to Bugsnag. - | - | Example: array('development', 'production') - | - */ - 'notify_release_stages' => env('BUGSNAG_NOTIFY_RELEASE_STAGES', null), + /* + |-------------------------------------------------------------------------- + | Notify Release Stages + |-------------------------------------------------------------------------- + | + | Set which release stages should send notifications to Bugsnag. + | + | Example: array('development', 'production') + | + */ + 'notify_release_stages' => env('BUGSNAG_NOTIFY_RELEASE_STAGES', null), - /* - |-------------------------------------------------------------------------- - | Endpoint - |-------------------------------------------------------------------------- - | - | Set what server the Bugsnag notifier should send errors to. By default - | this is set to 'https://notify.bugsnag.com', but for Bugsnag Enterprise - | this should be the URL to your Bugsnag instance. - | - */ - 'endpoint' => env('BUGSNAG_ENDPOINT', null), + /* + |-------------------------------------------------------------------------- + | Endpoint + |-------------------------------------------------------------------------- + | + | Set what server the Bugsnag notifier should send errors to. By default + | this is set to 'https://notify.bugsnag.com', but for Bugsnag Enterprise + | this should be the URL to your Bugsnag instance. + | + */ + 'endpoint' => env('BUGSNAG_ENDPOINT', null), - /* - |-------------------------------------------------------------------------- - | Filters - |-------------------------------------------------------------------------- - | - | Use this if you want to ensure you don't send sensitive data such as - | passwords, and credit card numbers to our servers. Any keys which - | contain these strings will be filtered. - | - */ - 'filters' => env('BUGSNAG_FILTERS', array('password')), + /* + |-------------------------------------------------------------------------- + | Filters + |-------------------------------------------------------------------------- + | + | Use this if you want to ensure you don't send sensitive data such as + | passwords, and credit card numbers to our servers. Any keys which + | contain these strings will be filtered. + | + */ + 'filters' => env('BUGSNAG_FILTERS', array('password')), - /* - |-------------------------------------------------------------------------- - | Proxy - |-------------------------------------------------------------------------- - | - | If your server is behind a proxy server, you can configure this as well. - | Other than the host, none of these settings are mandatory. - | - | Note: Proxy configuration is only possible if the PHP cURL extension - | is installed. - | - | Example: - | - | 'proxy' => array( - | 'host' => 'bugsnag.com', - | 'port' => 42, - | 'user' => 'username', - | 'password' => 'password123' - | ) - | - */ - 'proxy' => env('BUGSNAG_PROXY', null) + /* + |-------------------------------------------------------------------------- + | Proxy + |-------------------------------------------------------------------------- + | + | If your server is behind a proxy server, you can configure this as well. + | Other than the host, none of these settings are mandatory. + | + | Note: Proxy configuration is only possible if the PHP cURL extension + | is installed. + | + | Example: + | + | 'proxy' => array( + | 'host' => 'bugsnag.com', + | 'port' => 42, + | 'user' => 'username', + | 'password' => 'password123' + | ) + | + */ + 'proxy' => env('BUGSNAG_PROXY', null), ); diff --git a/src/config/config.php b/src/config/config.php index 0eb61c45..a4ab525d 100644 --- a/src/config/config.php +++ b/src/config/config.php @@ -2,76 +2,76 @@ return array( - /* - |-------------------------------------------------------------------------- - | API Key - |-------------------------------------------------------------------------- - | - | You can find your API key on your Bugsnag dashboard. - | - | This api key points the Bugsnag notifier to the project in your account - | which should receive your application's uncaught exceptions. - | - */ - 'api_key' => 'YOUR-API-KEY-HERE', + /* + |-------------------------------------------------------------------------- + | API Key + |-------------------------------------------------------------------------- + | + | You can find your API key on your Bugsnag dashboard. + | + | This api key points the Bugsnag notifier to the project in your account + | which should receive your application's uncaught exceptions. + | + */ + 'api_key' => 'YOUR-API-KEY-HERE', - /* - |-------------------------------------------------------------------------- - | Notify Release Stages - |-------------------------------------------------------------------------- - | - | Set which release stages should send notifications to Bugsnag. - | - | Example: array('development', 'production') - | - */ - 'notify_release_stages' => null, + /* + |-------------------------------------------------------------------------- + | Notify Release Stages + |-------------------------------------------------------------------------- + | + | Set which release stages should send notifications to Bugsnag. + | + | Example: array('development', 'production') + | + */ + 'notify_release_stages' => null, - /* - |-------------------------------------------------------------------------- - | Endpoint - |-------------------------------------------------------------------------- - | - | Set what server the Bugsnag notifier should send errors to. By default - | this is set to 'https://notify.bugsnag.com', but for Bugsnag Enterprise - | this should be the URL to your Bugsnag instance. - | - */ - 'endpoint' => null, + /* + |-------------------------------------------------------------------------- + | Endpoint + |-------------------------------------------------------------------------- + | + | Set what server the Bugsnag notifier should send errors to. By default + | this is set to 'https://notify.bugsnag.com', but for Bugsnag Enterprise + | this should be the URL to your Bugsnag instance. + | + */ + 'endpoint' => null, - /* - |-------------------------------------------------------------------------- - | Filters - |-------------------------------------------------------------------------- - | - | Use this if you want to ensure you don't send sensitive data such as - | passwords, and credit card numbers to our servers. Any keys which - | contain these strings will be filtered. - | - */ - 'filters' => array('password'), + /* + |-------------------------------------------------------------------------- + | Filters + |-------------------------------------------------------------------------- + | + | Use this if you want to ensure you don't send sensitive data such as + | passwords, and credit card numbers to our servers. Any keys which + | contain these strings will be filtered. + | + */ + 'filters' => array('password'), - /* - |-------------------------------------------------------------------------- - | Proxy - |-------------------------------------------------------------------------- - | - | If your server is behind a proxy server, you can configure this as well. - | Other than the host, none of these settings are mandatory. - | - | Note: Proxy configuration is only possible if the PHP cURL extension - | is installed. - | - | Example: - | - | 'proxy' => array( - | 'host' => 'bugsnag.com', - | 'port' => 42, - | 'user' => 'username', - | 'password' => 'password123' - | ) - | - */ - 'proxy' => null + /* + |-------------------------------------------------------------------------- + | Proxy + |-------------------------------------------------------------------------- + | + | If your server is behind a proxy server, you can configure this as well. + | Other than the host, none of these settings are mandatory. + | + | Note: Proxy configuration is only possible if the PHP cURL extension + | is installed. + | + | Example: + | + | 'proxy' => array( + | 'host' => 'bugsnag.com', + | 'port' => 42, + | 'user' => 'username', + | 'password' => 'password123' + | ) + | + */ + 'proxy' => null, );