diff --git a/app/Http/Controllers/StatusPageController.php b/app/Http/Controllers/StatusPageController.php index ba576a55b..712fd9c14 100644 --- a/app/Http/Controllers/StatusPageController.php +++ b/app/Http/Controllers/StatusPageController.php @@ -98,9 +98,9 @@ class StatusPageController extends AbstractApiController $allIncidents = Incident::with('component', 'updates.incident') ->where('visible', '>=', (int) !Auth::check())->whereBetween('occurred_at', [ - $endDate->format('Y-m-d').' 00:00:00', - $startDate->format('Y-m-d').' 23:59:59', - ])->orderBy('occurred_at', 'desc')->get()->groupBy(function (Incident $incident) { + $endDate->format('Y-m-d').' 00:00:00', + $startDate->format('Y-m-d').' 23:59:59', + ])->orderBy('occurred_at', 'desc')->get()->groupBy(function (Incident $incident) { return app(DateFactory::class)->make($incident->occurred_at)->toDateString(); }); diff --git a/app/Models/Component.php b/app/Models/Component.php index 5f37c0783..08da71576 100644 --- a/app/Models/Component.php +++ b/app/Models/Component.php @@ -24,12 +24,12 @@ use McCool\LaravelAutoPresenter\HasPresenter; class Component extends Model implements HasPresenter { - use HasTags, - HasMeta, - SearchableTrait, - SoftDeletes, - SortableTrait, - ValidatingTrait; + use HasTags; + use HasMeta; + use SearchableTrait; + use SoftDeletes; + use SortableTrait; + use ValidatingTrait; /** * List of attributes that have default values. diff --git a/app/Models/ComponentGroup.php b/app/Models/ComponentGroup.php index 6aebc82cc..f5a8af8de 100644 --- a/app/Models/ComponentGroup.php +++ b/app/Models/ComponentGroup.php @@ -27,8 +27,9 @@ use McCool\LaravelAutoPresenter\HasPresenter; */ class ComponentGroup extends Model implements HasPresenter { - use SearchableTrait, SortableTrait, ValidatingTrait; - + use SearchableTrait; + use SortableTrait; + use ValidatingTrait; /** * Viewable only authenticated users. * diff --git a/app/Models/Incident.php b/app/Models/Incident.php index 772e71c8f..b1ddb58c0 100644 --- a/app/Models/Incident.php +++ b/app/Models/Incident.php @@ -31,12 +31,12 @@ use McCool\LaravelAutoPresenter\HasPresenter; */ class Incident extends Model implements HasPresenter { - use HasMeta, - HasTags, - SearchableTrait, - SoftDeletes, - SortableTrait, - ValidatingTrait; + use HasMeta; + use HasTags; + use SearchableTrait; + use SoftDeletes; + use SortableTrait; + use ValidatingTrait; /** * Status for incident being investigated. diff --git a/app/Models/IncidentUpdate.php b/app/Models/IncidentUpdate.php index a6474661a..1db830b60 100644 --- a/app/Models/IncidentUpdate.php +++ b/app/Models/IncidentUpdate.php @@ -24,8 +24,8 @@ use McCool\LaravelAutoPresenter\HasPresenter; */ class IncidentUpdate extends Model implements HasPresenter { - use SortableTrait, ValidatingTrait; - + use SortableTrait; + use ValidatingTrait; /** * The attributes that should be casted to native types. * diff --git a/app/Models/Metric.php b/app/Models/Metric.php index 8f1e98df0..c3e6483ec 100644 --- a/app/Models/Metric.php +++ b/app/Models/Metric.php @@ -23,9 +23,9 @@ use McCool\LaravelAutoPresenter\HasPresenter; class Metric extends Model implements HasPresenter { - use HasMeta, - SortableTrait, - ValidatingTrait; + use HasMeta; + use SortableTrait; + use ValidatingTrait; /** * The calculation type of sum. diff --git a/app/Models/Schedule.php b/app/Models/Schedule.php index 612084266..93a7e3bbd 100644 --- a/app/Models/Schedule.php +++ b/app/Models/Schedule.php @@ -24,11 +24,11 @@ use McCool\LaravelAutoPresenter\HasPresenter; class Schedule extends Model implements HasPresenter { - use HasMeta, - SearchableTrait, - SoftDeletes, - SortableTrait, - ValidatingTrait; + use HasMeta; + use SearchableTrait; + use SoftDeletes; + use SortableTrait; + use ValidatingTrait; /** * The upcoming status. diff --git a/app/Models/Subscriber.php b/app/Models/Subscriber.php index 74b473d44..e10a093b1 100644 --- a/app/Models/Subscriber.php +++ b/app/Models/Subscriber.php @@ -29,9 +29,9 @@ use McCool\LaravelAutoPresenter\HasPresenter; */ class Subscriber extends Model implements HasPresenter { - use HasMeta, - Notifiable, - ValidatingTrait; + use HasMeta; + use Notifiable; + use ValidatingTrait; /** * The attributes that should be casted to native types. diff --git a/app/Models/User.php b/app/Models/User.php index 0422082ba..7e568bd05 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -26,8 +26,8 @@ use Illuminate\Support\Str; */ class User extends Authenticatable { - use Notifiable, ValidatingTrait; - + use Notifiable; + use ValidatingTrait; /** * The admin level of user. * diff --git a/app/Notifications/Component/ComponentStatusChangedNotification.php b/app/Notifications/Component/ComponentStatusChangedNotification.php index 47502ed23..02d02d4ac 100644 --- a/app/Notifications/Component/ComponentStatusChangedNotification.php +++ b/app/Notifications/Component/ComponentStatusChangedNotification.php @@ -92,7 +92,7 @@ class ComponentStatusChangedNotification extends Notification 'unsubscribeUrl' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code), 'manageSubscriptionText' => trans('cachet.subscriber.manage_subscription'), 'manageSubscriptionUrl' => cachet_route('subscribe.manage', $notifiable->verify_code), - ]); + ]); } /** @@ -144,11 +144,11 @@ class ComponentStatusChangedNotification extends Notification ->attachment(function ($attachment) use ($content, $notifiable) { $attachment->title($content, cachet_route('status-page')) ->fields(array_filter([ - 'Component' => $this->component->name, - 'Old Status' => $this->component->human_status, - 'New Status' => trans("cachet.components.status.{$this->status}"), - 'Link' => $this->component->link, - ])) + 'Component' => $this->component->name, + 'Old Status' => $this->component->human_status, + 'New Status' => trans("cachet.components.status.{$this->status}"), + 'Link' => $this->component->link, + ])) ->footer(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)])); }); } diff --git a/app/Notifications/Incident/NewIncidentNotification.php b/app/Notifications/Incident/NewIncidentNotification.php index c0f956b29..d1ddc6013 100644 --- a/app/Notifications/Incident/NewIncidentNotification.php +++ b/app/Notifications/Incident/NewIncidentNotification.php @@ -131,9 +131,9 @@ class NewIncidentNotification extends Notification $attachment->title(trans('notifications.incident.new.slack.title', ['name' => $this->incident->name])) ->timestamp($this->incident->getWrappedObject()->occurred_at) ->fields(array_filter([ - 'ID' => "#{$this->incident->id}", - 'Link' => $this->incident->permalink, - ])); + 'ID' => "#{$this->incident->id}", + 'Link' => $this->incident->permalink, + ])); }); } } diff --git a/app/Notifications/IncidentUpdate/IncidentUpdatedNotification.php b/app/Notifications/IncidentUpdate/IncidentUpdatedNotification.php index 758f9afea..c9b5a0009 100644 --- a/app/Notifications/IncidentUpdate/IncidentUpdatedNotification.php +++ b/app/Notifications/IncidentUpdate/IncidentUpdatedNotification.php @@ -88,7 +88,7 @@ class IncidentUpdatedNotification extends Notification 'unsubscribeUrl' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code), 'manageSubscriptionText' => trans('cachet.subscriber.manage_subscription'), 'manageSubscriptionUrl' => cachet_route('subscribe.manage', $notifiable->verify_code), - ]); + ]); } /** @@ -136,14 +136,14 @@ class IncidentUpdatedNotification extends Notification ->content($content) ->attachment(function ($attachment) use ($content, $notifiable) { $attachment->title(trans('notifications.incident.update.slack.title', [ - 'name' => $this->update->incident->name, - 'new_status' => $this->update->human_status, - ])) + 'name' => $this->update->incident->name, + 'new_status' => $this->update->human_status, + ])) ->timestamp($this->update->getWrappedObject()->created_at) ->fields(array_filter([ - 'ID' => "#{$this->update->id}", - 'Link' => $this->update->permalink, - ])) + 'ID' => "#{$this->update->id}", + 'Link' => $this->update->permalink, + ])) ->footer(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)])); }); } diff --git a/app/Notifications/Schedule/NewScheduleNotification.php b/app/Notifications/Schedule/NewScheduleNotification.php index b86c61def..3b04bc679 100644 --- a/app/Notifications/Schedule/NewScheduleNotification.php +++ b/app/Notifications/Schedule/NewScheduleNotification.php @@ -82,7 +82,7 @@ class NewScheduleNotification extends Notification implements ShouldQueue 'unsubscribeUrl' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code), 'manageSubscriptionText' => trans('cachet.subscriber.manage_subscription'), 'manageSubscriptionUrl' => cachet_route('subscribe.manage', $notifiable->verify_code), - ]); + ]); } /** @@ -122,9 +122,9 @@ class NewScheduleNotification extends Notification implements ShouldQueue $attachment->title($content) ->timestamp($this->schedule->getWrappedObject()->scheduled_at) ->fields(array_filter([ - 'ID' => "#{$this->schedule->id}", - 'Status' => $this->schedule->human_status, - ])); + 'ID' => "#{$this->schedule->id}", + 'Status' => $this->schedule->human_status, + ])); }); } } diff --git a/app/Repositories/Metric/MySqlRepository.php b/app/Repositories/Metric/MySqlRepository.php index 3633a4518..3d5e37159 100644 --- a/app/Repositories/Metric/MySqlRepository.php +++ b/app/Repositories/Metric/MySqlRepository.php @@ -39,9 +39,9 @@ class MySqlRepository extends AbstractMetricRepository implements MetricInterfac "AND {$this->getMetricPointsTable()}.`created_at` >= DATE_SUB(NOW(), INTERVAL :minutes MINUTE) ". "AND {$this->getMetricPointsTable()}.`created_at` <= NOW() ". "GROUP BY HOUR({$this->getMetricPointsTable()}.`created_at`), MINUTE({$this->getMetricPointsTable()}.`created_at`) ORDER BY {$this->getMetricPointsTable()}.`created_at`", [ - 'metricId' => $metric->id, - 'minutes' => $minutes, - ]); + 'metricId' => $metric->id, + 'minutes' => $minutes, + ]); return $this->mapResults($metric, $points); } @@ -64,9 +64,9 @@ class MySqlRepository extends AbstractMetricRepository implements MetricInterfac "AND {$this->getMetricPointsTable()}.`created_at` <= NOW() ". "GROUP BY HOUR({$this->getMetricPointsTable()}.`created_at`) ". "ORDER BY {$this->getMetricPointsTable()}.`created_at`", [ - 'metricId' => $metric->id, - 'hour' => $hour, - ]); + 'metricId' => $metric->id, + 'hour' => $hour, + ]); return $this->mapResults($metric, $points); } @@ -88,9 +88,9 @@ class MySqlRepository extends AbstractMetricRepository implements MetricInterfac "AND {$this->getMetricPointsTable()}.`created_at` >= DATE_SUB(NOW(), INTERVAL :day DAY) ". "AND {$this->getMetricPointsTable()}.`created_at` <= NOW() ". "GROUP BY DATE({$this->getMetricPointsTable()}.`created_at`) ORDER BY {$this->getMetricPointsTable()}.`created_at`", [ - 'metricId' => $metric->id, - 'day' => $day, - ]); + 'metricId' => $metric->id, + 'day' => $day, + ]); return $this->mapResults($metric, $points); } diff --git a/app/Repositories/Metric/PgSqlRepository.php b/app/Repositories/Metric/PgSqlRepository.php index 4d09e33af..e5209ade3 100644 --- a/app/Repositories/Metric/PgSqlRepository.php +++ b/app/Repositories/Metric/PgSqlRepository.php @@ -39,8 +39,8 @@ class PgSqlRepository extends AbstractMetricRepository implements MetricInterfac "AND {$this->getMetricPointsTable()}.created_at <= NOW() ". "GROUP BY to_char({$this->getMetricPointsTable()}.created_at, 'HH24:MI') ". "ORDER BY {$this->getMetricPointsTable()}.created_at", [ - 'metricId' => $metric->id, - ]); + 'metricId' => $metric->id, + ]); return $this->mapResults($metric, $points); } @@ -63,8 +63,8 @@ class PgSqlRepository extends AbstractMetricRepository implements MetricInterfac "AND {$this->getMetricPointsTable()}.created_at <= NOW() ". "GROUP BY to_char({$this->getMetricPointsTable()}.created_at, 'HH24:00') ". "ORDER BY {$this->getMetricPointsTable()}.created_at", [ - 'metricId' => $metric->id, - ]); + 'metricId' => $metric->id, + ]); return $this->mapResults($metric, $points); } @@ -87,8 +87,8 @@ class PgSqlRepository extends AbstractMetricRepository implements MetricInterfac "AND {$this->getMetricPointsTable()}.created_at <= DATE(NOW()) ". "GROUP BY DATE({$this->getMetricPointsTable()}.created_at) ". "ORDER BY DATE({$this->getMetricPointsTable()}.created_at)", [ - 'metricId' => $metric->id, - ]); + 'metricId' => $metric->id, + ]); return $this->mapResults($metric, $points); } diff --git a/app/Repositories/Metric/SqliteRepository.php b/app/Repositories/Metric/SqliteRepository.php index f8cd71e93..d979e084a 100644 --- a/app/Repositories/Metric/SqliteRepository.php +++ b/app/Repositories/Metric/SqliteRepository.php @@ -40,8 +40,8 @@ class SqliteRepository extends AbstractMetricRepository implements MetricInterfa "AND {$this->getMetricPointsTable()}.`created_at` <= datetime('now', 'localtime') ". "GROUP BY strftime('%H', {$this->getMetricPointsTable()}.`created_at`), strftime('%M', {$this->getMetricPointsTable()}.`created_at`) ". "ORDER BY {$this->getMetricPointsTable()}.`created_at`", [ - 'metricId' => $metric->id, - ]); + 'metricId' => $metric->id, + ]); return $this->mapResults($metric, $points); } @@ -63,8 +63,8 @@ class SqliteRepository extends AbstractMetricRepository implements MetricInterfa "AND {$this->getMetricPointsTable()}.`created_at` >= datetime('now', 'localtime', '-{$hour} hours') ". "AND {$this->getMetricPointsTable()}.`created_at` <= datetime('now', 'localtime') ". "GROUP BY strftime('%H', {$this->getMetricPointsTable()}.`created_at`) ORDER BY {$this->getMetricPointsTable()}.`created_at`", [ - 'metricId' => $metric->id, - ]); + 'metricId' => $metric->id, + ]); return $this->mapResults($metric, $points); } @@ -87,8 +87,8 @@ class SqliteRepository extends AbstractMetricRepository implements MetricInterfa "AND {$this->getMetricPointsTable()}.`created_at` <= datetime('now', 'localtime') ". "GROUP BY DATE({$this->getMetricPointsTable()}.`created_at`) ". "ORDER BY {$this->getMetricPointsTable()}.`created_at`", [ - 'metricId' => $metric->id, - ]); + 'metricId' => $metric->id, + ]); return $this->mapResults($metric, $points); } diff --git a/config/cachet.php b/config/cachet.php index 2f193d21e..dd3f27051 100644 --- a/config/cachet.php +++ b/config/cachet.php @@ -31,7 +31,7 @@ return [ | */ - 'is_docker' => env('DOCKER', false), + 'is_docker' => env('DOCKER', false), /* |-------------------------------------------------------------------------- @@ -44,6 +44,6 @@ return [ | */ - 'beacon' => env('CACHET_BEACON', true), + 'beacon' => env('CACHET_BEACON', true), ]; diff --git a/config/services.php b/config/services.php index 5c54e205f..097fef01a 100644 --- a/config/services.php +++ b/config/services.php @@ -23,7 +23,7 @@ return [ | */ - 'github' => [ + 'github' => [ 'token' => env('GITHUB_TOKEN'), ], diff --git a/config/setting.php b/config/setting.php index c9615c356..d7917b33e 100644 --- a/config/setting.php +++ b/config/setting.php @@ -55,7 +55,7 @@ return [ | */ - 'automatic_localization' => false, + 'automatic_localization' => false, /* |-------------------------------------------------------------------------- @@ -79,7 +79,7 @@ return [ 'enable_external_dependencies' => true, - /* + /* |-------------------------------------------------------------------------- | Show the timezone |-------------------------------------------------------------------------- @@ -90,7 +90,7 @@ return [ 'show_timezone' => false, - /* + /* |-------------------------------------------------------------------------- | Skip subscriber verifications |-------------------------------------------------------------------------- @@ -101,7 +101,7 @@ return [ 'skip_subscriber_verification' => false, - /* + /* |-------------------------------------------------------------------------- | Only disrupted days |-------------------------------------------------------------------------- diff --git a/config/trustedproxy.php b/config/trustedproxy.php index b815629b2..e2fab5269 100644 --- a/config/trustedproxy.php +++ b/config/trustedproxy.php @@ -30,13 +30,13 @@ return [ * To trust one or more specific proxies that connect * directly to your server, use an array of IP addresses: */ - // 'proxies' => ['192.168.1.1'], + // 'proxies' => ['192.168.1.1'], /* * Or, to trust all proxies that connect * directly to your server, use a "*" */ - // 'proxies' => '*', + // 'proxies' => '*', /* * Which headers to use to detect proxy related data (For, Host, Proto, Port) diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php index 80c93e0ae..850f9b76a 100644 --- a/database/factories/ModelFactory.php +++ b/database/factories/ModelFactory.php @@ -104,15 +104,15 @@ $factory->define(Schedule::class, function ($faker) { $factory->define(Setting::class, function ($faker) { return [ - 'name' => 'app_name', - 'value' => 'Cachet Test Demo', + 'name' => 'app_name', + 'value' => 'Cachet Test Demo', ]; }); $factory->define(Setting::class, function ($faker) { return [ - 'name' => 'app_refresh_rate', - 'value' => '0', + 'name' => 'app_refresh_rate', + 'value' => '0', ]; }); diff --git a/tests/Bus/Events/Component/ComponentStatusWasChangedEventTest.php b/tests/Bus/Events/Component/ComponentStatusWasChangedEventTest.php index 43fc7df5e..03ff21ba1 100644 --- a/tests/Bus/Events/Component/ComponentStatusWasChangedEventTest.php +++ b/tests/Bus/Events/Component/ComponentStatusWasChangedEventTest.php @@ -24,8 +24,8 @@ use MailThief\Testing\InteractsWithMail; */ class ComponentStatusWasChangedEventTest extends AbstractComponentEventTestCase { - use DatabaseMigrations, InteractsWithMail; - + use DatabaseMigrations; + use InteractsWithMail; public function testComponentUpdateEmailWasSent() { $user = factory('CachetHQ\Cachet\Models\User')->create();