From 98795c82200c53477a90d4b41addc85a90ba669e Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Thu, 24 Dec 2015 15:15:14 +0000 Subject: [PATCH 1/4] Bumped the minimum laravel vesion --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 16eece05a..3b8c8df4c 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ ], "require": { "php": ">=5.5.9", - "laravel/framework": "~5.1.26", + "laravel/framework": "~5.1.28", "alt-three/emoji": "^2.1", "alt-three/validator": "^1.4", "barryvdh/laravel-cors": "^0.7", From 5557edc342b301f6f42d22a3e713b9be3660805a Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Thu, 24 Dec 2015 15:16:09 +0000 Subject: [PATCH 2/4] Use the new dispatch helper function --- .../SubscribeSubscriberCommandHandler.php | 5 +---- app/Http/Controllers/Api/ComponentController.php | 9 +++------ .../Controllers/Api/ComponentGroupController.php | 9 +++------ app/Http/Controllers/Api/IncidentController.php | 9 +++------ app/Http/Controllers/Api/MetricController.php | 9 +++------ .../Controllers/Api/MetricPointController.php | 9 +++------ app/Http/Controllers/Api/SubscriberController.php | 7 ++----- .../Controllers/Dashboard/ComponentController.php | 15 ++++++--------- .../Controllers/Dashboard/IncidentController.php | 9 +++------ .../Controllers/Dashboard/MetricController.php | 9 +++------ .../Controllers/Dashboard/ScheduleController.php | 5 +---- .../Dashboard/SubscriberController.php | 7 ++----- app/Http/Controllers/Dashboard/TeamController.php | 9 +++------ app/Http/Controllers/SignupController.php | 7 ++----- app/Http/Controllers/SubscribeController.php | 9 +++------ 15 files changed, 41 insertions(+), 86 deletions(-) diff --git a/app/Handlers/Commands/Subscriber/SubscribeSubscriberCommandHandler.php b/app/Handlers/Commands/Subscriber/SubscribeSubscriberCommandHandler.php index 9ab617ede..cc9a858eb 100644 --- a/app/Handlers/Commands/Subscriber/SubscribeSubscriberCommandHandler.php +++ b/app/Handlers/Commands/Subscriber/SubscribeSubscriberCommandHandler.php @@ -16,12 +16,9 @@ use CachetHQ\Cachet\Commands\Subscriber\VerifySubscriberCommand; use CachetHQ\Cachet\Events\Subscriber\SubscriberHasSubscribedEvent; use CachetHQ\Cachet\Exceptions\AlreadySubscribedException; use CachetHQ\Cachet\Models\Subscriber; -use Illuminate\Foundation\Bus\DispatchesJobs; class SubscribeSubscriberCommandHandler { - use DispatchesJobs; - /** * Handle the subscribe subscriber command. * @@ -40,7 +37,7 @@ class SubscribeSubscriberCommandHandler $subscriber = Subscriber::create(['email' => $command->email]); if ($command->verified) { - $this->dispatch(new VerifySubscriberCommand($subscriber)); + dispatch(new VerifySubscriberCommand($subscriber)); } else { event(new SubscriberHasSubscribedEvent($subscriber)); } diff --git a/app/Http/Controllers/Api/ComponentController.php b/app/Http/Controllers/Api/ComponentController.php index 0586667ca..0fdc1ae7e 100644 --- a/app/Http/Controllers/Api/ComponentController.php +++ b/app/Http/Controllers/Api/ComponentController.php @@ -19,14 +19,11 @@ use CachetHQ\Cachet\Models\Tag; use GrahamCampbell\Binput\Facades\Binput; use Illuminate\Contracts\Auth\Guard; use Illuminate\Database\QueryException; -use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Support\Facades\Request; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; class ComponentController extends AbstractApiController { - use DispatchesJobs; - /** * Get all components. * @@ -63,7 +60,7 @@ class ComponentController extends AbstractApiController public function postComponents() { try { - $component = $this->dispatch(new AddComponentCommand( + $component = dispatch(new AddComponentCommand( Binput::get('name'), Binput::get('description'), Binput::get('status'), @@ -103,7 +100,7 @@ class ComponentController extends AbstractApiController public function putComponent(Component $component) { try { - $this->dispatch(new UpdateComponentCommand( + dispatch(new UpdateComponentCommand( $component, Binput::get('name'), Binput::get('description'), @@ -140,7 +137,7 @@ class ComponentController extends AbstractApiController */ public function deleteComponent(Component $component) { - $this->dispatch(new RemoveComponentCommand($component)); + dispatch(new RemoveComponentCommand($component)); return $this->noContent(); } diff --git a/app/Http/Controllers/Api/ComponentGroupController.php b/app/Http/Controllers/Api/ComponentGroupController.php index 5ac345198..071e34b36 100644 --- a/app/Http/Controllers/Api/ComponentGroupController.php +++ b/app/Http/Controllers/Api/ComponentGroupController.php @@ -17,14 +17,11 @@ use CachetHQ\Cachet\Commands\ComponentGroup\UpdateComponentGroupCommand; use CachetHQ\Cachet\Models\ComponentGroup; use GrahamCampbell\Binput\Facades\Binput; use Illuminate\Database\QueryException; -use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Support\Facades\Request; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; class ComponentGroupController extends AbstractApiController { - use DispatchesJobs; - /** * Get all groups. * @@ -57,7 +54,7 @@ class ComponentGroupController extends AbstractApiController public function postGroups() { try { - $group = $this->dispatch(new AddComponentGroupCommand( + $group = dispatch(new AddComponentGroupCommand( Binput::get('name'), Binput::get('order', 0) )); @@ -78,7 +75,7 @@ class ComponentGroupController extends AbstractApiController public function putGroup(ComponentGroup $group) { try { - $group = $this->dispatch(new UpdateComponentGroupCommand( + $group = dispatch(new UpdateComponentGroupCommand( $group, Binput::get('name'), Binput::get('order', 0) @@ -99,7 +96,7 @@ class ComponentGroupController extends AbstractApiController */ public function deleteGroup(ComponentGroup $group) { - $this->dispatch(new RemoveComponentGroupCommand($group)); + dispatch(new RemoveComponentGroupCommand($group)); return $this->noContent(); } diff --git a/app/Http/Controllers/Api/IncidentController.php b/app/Http/Controllers/Api/IncidentController.php index 9a0ac75e1..60c779353 100644 --- a/app/Http/Controllers/Api/IncidentController.php +++ b/app/Http/Controllers/Api/IncidentController.php @@ -18,14 +18,11 @@ use CachetHQ\Cachet\Models\Incident; use GrahamCampbell\Binput\Facades\Binput; use Illuminate\Contracts\Auth\Guard; use Illuminate\Database\QueryException; -use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Support\Facades\Request; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; class IncidentController extends AbstractApiController { - use DispatchesJobs; - /** * Get all incidents. * @@ -60,7 +57,7 @@ class IncidentController extends AbstractApiController public function postIncidents() { try { - $incident = $this->dispatch(new ReportIncidentCommand( + $incident = dispatch(new ReportIncidentCommand( Binput::get('name'), Binput::get('status'), Binput::get('message'), @@ -89,7 +86,7 @@ class IncidentController extends AbstractApiController public function putIncident(Incident $incident) { try { - $incident = $this->dispatch(new UpdateIncidentCommand( + $incident = dispatch(new UpdateIncidentCommand( $incident, Binput::get('name'), Binput::get('status'), @@ -118,7 +115,7 @@ class IncidentController extends AbstractApiController */ public function deleteIncident(Incident $incident) { - $this->dispatch(new RemoveIncidentCommand($incident)); + dispatch(new RemoveIncidentCommand($incident)); return $this->noContent(); } diff --git a/app/Http/Controllers/Api/MetricController.php b/app/Http/Controllers/Api/MetricController.php index 9fbabd6b7..96ff0df9b 100644 --- a/app/Http/Controllers/Api/MetricController.php +++ b/app/Http/Controllers/Api/MetricController.php @@ -17,14 +17,11 @@ use CachetHQ\Cachet\Commands\Metric\UpdateMetricCommand; use CachetHQ\Cachet\Models\Metric; use GrahamCampbell\Binput\Facades\Binput; use Illuminate\Database\QueryException; -use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Support\Facades\Request; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; class MetricController extends AbstractApiController { - use DispatchesJobs; - /** * Get all metrics. * @@ -69,7 +66,7 @@ class MetricController extends AbstractApiController public function postMetrics() { try { - $metric = $this->dispatch(new AddMetricCommand( + $metric = dispatch(new AddMetricCommand( Binput::get('name'), Binput::get('suffix'), Binput::get('description'), @@ -95,7 +92,7 @@ class MetricController extends AbstractApiController public function putMetric(Metric $metric) { try { - $metric = $this->dispatch(new UpdateMetricCommand( + $metric = dispatch(new UpdateMetricCommand( $metric, Binput::get('name'), Binput::get('suffix'), @@ -121,7 +118,7 @@ class MetricController extends AbstractApiController */ public function deleteMetric(Metric $metric) { - $this->dispatch(new RemoveMetricCommand($metric)); + dispatch(new RemoveMetricCommand($metric)); return $this->noContent(); } diff --git a/app/Http/Controllers/Api/MetricPointController.php b/app/Http/Controllers/Api/MetricPointController.php index 9dc59a587..11e3d7690 100644 --- a/app/Http/Controllers/Api/MetricPointController.php +++ b/app/Http/Controllers/Api/MetricPointController.php @@ -18,13 +18,10 @@ use CachetHQ\Cachet\Models\Metric; use CachetHQ\Cachet\Models\MetricPoint; use GrahamCampbell\Binput\Facades\Binput; use Illuminate\Database\QueryException; -use Illuminate\Foundation\Bus\DispatchesJobs; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; class MetricPointController extends AbstractApiController { - use DispatchesJobs; - /** * Get a single metric point. * @@ -48,7 +45,7 @@ class MetricPointController extends AbstractApiController public function postMetricPoints(Metric $metric) { try { - $metricPoint = $this->dispatch(new AddMetricPointCommand( + $metricPoint = dispatch(new AddMetricPointCommand( $metric, Binput::get('value'), Binput::get('timestamp')) @@ -70,7 +67,7 @@ class MetricPointController extends AbstractApiController */ public function putMetricPoint(Metric $metric, MetricPoint $metricPoint) { - $metricPoint = $this->dispatch(new UpdateMetricPointCommand( + $metricPoint = dispatch(new UpdateMetricPointCommand( $metricPoint, $metric, Binput::get('value'), @@ -90,7 +87,7 @@ class MetricPointController extends AbstractApiController */ public function deleteMetricPoint(Metric $metric, MetricPoint $metricPoint) { - $this->dispatch(new RemoveMetricPointCommand($metricPoint)); + dispatch(new RemoveMetricPointCommand($metricPoint)); return $this->noContent(); } diff --git a/app/Http/Controllers/Api/SubscriberController.php b/app/Http/Controllers/Api/SubscriberController.php index 44fbffaab..3998a80d3 100644 --- a/app/Http/Controllers/Api/SubscriberController.php +++ b/app/Http/Controllers/Api/SubscriberController.php @@ -16,14 +16,11 @@ use CachetHQ\Cachet\Commands\Subscriber\UnsubscribeSubscriberCommand; use CachetHQ\Cachet\Models\Subscriber; use GrahamCampbell\Binput\Facades\Binput; use Illuminate\Database\QueryException; -use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Support\Facades\Request; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; class SubscriberController extends AbstractApiController { - use DispatchesJobs; - /** * Get all subscribers. * @@ -44,7 +41,7 @@ class SubscriberController extends AbstractApiController public function postSubscribers() { try { - $subscriber = $this->dispatch(new SubscribeSubscriberCommand(Binput::get('email'), Binput::get('verify', false))); + $subscriber = dispatch(new SubscribeSubscriberCommand(Binput::get('email'), Binput::get('verify', false))); } catch (QueryException $e) { throw new BadRequestHttpException(); } @@ -61,7 +58,7 @@ class SubscriberController extends AbstractApiController */ public function deleteSubscriber(Subscriber $subscriber) { - $this->dispatch(new UnsubscribeSubscriberCommand($subscriber)); + dispatch(new UnsubscribeSubscriberCommand($subscriber)); return $this->noContent(); } diff --git a/app/Http/Controllers/Dashboard/ComponentController.php b/app/Http/Controllers/Dashboard/ComponentController.php index 82f3ea720..1d5896fbf 100644 --- a/app/Http/Controllers/Dashboard/ComponentController.php +++ b/app/Http/Controllers/Dashboard/ComponentController.php @@ -22,15 +22,12 @@ use CachetHQ\Cachet\Models\Component; use CachetHQ\Cachet\Models\ComponentGroup; use CachetHQ\Cachet\Models\Tag; use GrahamCampbell\Binput\Facades\Binput; -use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Routing\Controller; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\View; class ComponentController extends Controller { - use DispatchesJobs; - /** * Array of sub-menu items. * @@ -130,7 +127,7 @@ class ComponentController extends Controller $tags = array_pull($componentData, 'tags'); try { - $component = $this->dispatch(new UpdateComponentCommand( + $component = dispatch(new UpdateComponentCommand( $component, $componentData['name'], $componentData['description'], @@ -184,7 +181,7 @@ class ComponentController extends Controller $tags = array_pull($componentData, 'tags'); try { - $component = $this->dispatch(new AddComponentCommand( + $component = dispatch(new AddComponentCommand( $componentData['name'], $componentData['description'], $componentData['status'], @@ -223,7 +220,7 @@ class ComponentController extends Controller */ public function deleteComponentAction(Component $component) { - $this->dispatch(new RemoveComponentCommand($component)); + dispatch(new RemoveComponentCommand($component)); return Redirect::route('dashboard.components.index') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.delete.success'))); @@ -238,7 +235,7 @@ class ComponentController extends Controller */ public function deleteComponentGroupAction(ComponentGroup $group) { - $this->dispatch(new RemoveComponentGroupCommand($group)); + dispatch(new RemoveComponentGroupCommand($group)); return Redirect::route('dashboard.components.index') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.delete.success'))); @@ -277,7 +274,7 @@ class ComponentController extends Controller public function postAddComponentGroup() { try { - $group = $this->dispatch(new AddComponentGroupCommand( + $group = dispatch(new AddComponentGroupCommand( Binput::get('name'), Binput::get('order', 0) )); @@ -302,7 +299,7 @@ class ComponentController extends Controller public function updateComponentGroupAction(ComponentGroup $group) { try { - $group = $this->dispatch(new UpdateComponentGroupCommand( + $group = dispatch(new UpdateComponentGroupCommand( $group, Binput::get('name'), Binput::get('order', 0) diff --git a/app/Http/Controllers/Dashboard/IncidentController.php b/app/Http/Controllers/Dashboard/IncidentController.php index 108a731f8..ec244a80d 100644 --- a/app/Http/Controllers/Dashboard/IncidentController.php +++ b/app/Http/Controllers/Dashboard/IncidentController.php @@ -20,15 +20,12 @@ use CachetHQ\Cachet\Models\ComponentGroup; use CachetHQ\Cachet\Models\Incident; use CachetHQ\Cachet\Models\IncidentTemplate; use GrahamCampbell\Binput\Facades\Binput; -use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Routing\Controller; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\View; class IncidentController extends Controller { - use DispatchesJobs; - /** * Stores the sub-sidebar tree list. * @@ -110,7 +107,7 @@ class IncidentController extends Controller public function createIncidentAction() { try { - $incident = $this->dispatch(new ReportIncidentCommand( + $incident = dispatch(new ReportIncidentCommand( Binput::get('name'), Binput::get('status'), Binput::get('message'), @@ -202,7 +199,7 @@ class IncidentController extends Controller */ public function deleteIncidentAction(Incident $incident) { - $this->dispatch(new RemoveIncidentCommand($incident)); + dispatch(new RemoveIncidentCommand($incident)); return Redirect::route('dashboard.incidents.index') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.delete.success'))); @@ -234,7 +231,7 @@ class IncidentController extends Controller public function editIncidentAction(Incident $incident) { try { - $incident = $this->dispatch(new UpdateIncidentCommand( + $incident = dispatch(new UpdateIncidentCommand( $incident, Binput::get('name'), Binput::get('status'), diff --git a/app/Http/Controllers/Dashboard/MetricController.php b/app/Http/Controllers/Dashboard/MetricController.php index e722562de..6afea8bf9 100644 --- a/app/Http/Controllers/Dashboard/MetricController.php +++ b/app/Http/Controllers/Dashboard/MetricController.php @@ -18,15 +18,12 @@ use CachetHQ\Cachet\Commands\Metric\UpdateMetricCommand; use CachetHQ\Cachet\Models\Metric; use CachetHQ\Cachet\Models\MetricPoint; use GrahamCampbell\Binput\Facades\Binput; -use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Routing\Controller; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\View; class MetricController extends Controller { - use DispatchesJobs; - /** * Shows the metrics view. * @@ -74,7 +71,7 @@ class MetricController extends Controller $metricData = Binput::get('metric'); try { - $this->dispatch(new AddMetricCommand( + dispatch(new AddMetricCommand( $metricData['name'], $metricData['suffix'], $metricData['description'], @@ -114,7 +111,7 @@ class MetricController extends Controller */ public function deleteMetricAction(Metric $metric) { - $this->dispatch(new RemoveMetricCommand($metric)); + dispatch(new RemoveMetricCommand($metric)); return Redirect::route('dashboard.metrics.index') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.metrics.delete.success'))); @@ -144,7 +141,7 @@ class MetricController extends Controller public function editMetricAction(Metric $metric) { try { - $this->dispatch(new UpdateMetricCommand( + dispatch(new UpdateMetricCommand( $metric, Binput::get('metric.name', null, false), Binput::get('metric.suffix', null, false), diff --git a/app/Http/Controllers/Dashboard/ScheduleController.php b/app/Http/Controllers/Dashboard/ScheduleController.php index f9b032059..0f6bad071 100644 --- a/app/Http/Controllers/Dashboard/ScheduleController.php +++ b/app/Http/Controllers/Dashboard/ScheduleController.php @@ -17,7 +17,6 @@ use CachetHQ\Cachet\Dates\DateFactory; use CachetHQ\Cachet\Models\Incident; use CachetHQ\Cachet\Models\IncidentTemplate; use GrahamCampbell\Binput\Facades\Binput; -use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Routing\Controller; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\View; @@ -26,8 +25,6 @@ use Jenssegers\Date\Date; class ScheduleController extends Controller { - use DispatchesJobs; - /** * Stores the sub-sidebar tree list. * @@ -97,7 +94,7 @@ class ScheduleController extends Controller public function addScheduleAction() { try { - $incident = $this->dispatch(new ReportMaintenanceCommand( + $incident = dispatch(new ReportMaintenanceCommand( Binput::get('incident.name'), Binput::get('incident.message'), Binput::get('incident.notify'), diff --git a/app/Http/Controllers/Dashboard/SubscriberController.php b/app/Http/Controllers/Dashboard/SubscriberController.php index 053fa1b7e..3d2576e60 100644 --- a/app/Http/Controllers/Dashboard/SubscriberController.php +++ b/app/Http/Controllers/Dashboard/SubscriberController.php @@ -16,15 +16,12 @@ use CachetHQ\Cachet\Commands\Subscriber\SubscribeSubscriberCommand; use CachetHQ\Cachet\Commands\Subscriber\UnsubscribeSubscriberCommand; use CachetHQ\Cachet\Models\Subscriber; use GrahamCampbell\Binput\Facades\Binput; -use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Routing\Controller; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\View; class SubscriberController extends Controller { - use DispatchesJobs; - /** * Shows the subscribers view. * @@ -56,7 +53,7 @@ class SubscriberController extends Controller public function createSubscriberAction() { try { - $this->dispatch(new SubscribeSubscriberCommand(Binput::get('email'))); + dispatch(new SubscribeSubscriberCommand(Binput::get('email'))); } catch (ValidationException $e) { return Redirect::route('dashboard.subscribers.add') ->withInput(Binput::all()) @@ -79,7 +76,7 @@ class SubscriberController extends Controller */ public function deleteSubscriberAction(Subscriber $subscriber) { - $this->dispatch(new UnsubscribeSubscriberCommand($subscriber)); + dispatch(new UnsubscribeSubscriberCommand($subscriber)); return Redirect::route('dashboard.subscribers.index'); } diff --git a/app/Http/Controllers/Dashboard/TeamController.php b/app/Http/Controllers/Dashboard/TeamController.php index e0d3b0588..5af7e34ab 100644 --- a/app/Http/Controllers/Dashboard/TeamController.php +++ b/app/Http/Controllers/Dashboard/TeamController.php @@ -17,15 +17,12 @@ use CachetHQ\Cachet\Commands\User\InviteTeamMemberCommand; use CachetHQ\Cachet\Commands\User\RemoveUserCommand; use CachetHQ\Cachet\Models\User; use GrahamCampbell\Binput\Facades\Binput; -use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Routing\Controller; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\View; class TeamController extends Controller { - use DispatchesJobs; - /** * Shows the team members view. * @@ -84,7 +81,7 @@ class TeamController extends Controller public function postAddUser() { try { - $this->dispatch(new AddTeamMemberCommand( + dispatch(new AddTeamMemberCommand( Binput::get('username'), Binput::get('password'), Binput::get('email'), @@ -133,7 +130,7 @@ class TeamController extends Controller public function postInviteUser() { try { - $this->dispatch(new InviteTeamMemberCommand( + dispatch(new InviteTeamMemberCommand( array_unique(array_filter((array) Binput::get('emails'))) )); } catch (ValidationException $e) { @@ -156,7 +153,7 @@ class TeamController extends Controller */ public function deleteUser(User $user) { - $this->dispatch(new RemoveUserCommand($user)); + dispatch(new RemoveUserCommand($user)); return Redirect::route('dashboard.team.index') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.delete.success'))); diff --git a/app/Http/Controllers/SignupController.php b/app/Http/Controllers/SignupController.php index 2e4b00554..ecb65030e 100644 --- a/app/Http/Controllers/SignupController.php +++ b/app/Http/Controllers/SignupController.php @@ -16,7 +16,6 @@ use CachetHQ\Cachet\Commands\Invite\ClaimInviteCommand; use CachetHQ\Cachet\Commands\User\SignupUserCommand; use CachetHQ\Cachet\Models\Invite; use GrahamCampbell\Binput\Facades\Binput; -use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Routing\Controller; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\View; @@ -25,8 +24,6 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; class SignupController extends Controller { - use DispatchesJobs; - /** * Handle the signup with invite. * @@ -72,7 +69,7 @@ class SignupController extends Controller } try { - $this->dispatch(new SignupUserCommand( + dispatch(new SignupUserCommand( Binput::get('username'), Binput::get('password'), Binput::get('email'), @@ -85,7 +82,7 @@ class SignupController extends Controller ->withErrors($e->getMessageBag()); } - $this->dispatch(new ClaimInviteCommand($invite)); + dispatch(new ClaimInviteCommand($invite)); return Redirect::route('status-page') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('cachet.signup.success'))); diff --git a/app/Http/Controllers/SubscribeController.php b/app/Http/Controllers/SubscribeController.php index 32114ee7d..533e97a85 100644 --- a/app/Http/Controllers/SubscribeController.php +++ b/app/Http/Controllers/SubscribeController.php @@ -20,7 +20,6 @@ use CachetHQ\Cachet\Facades\Setting; use CachetHQ\Cachet\Models\Subscriber; use GrahamCampbell\Binput\Facades\Binput; use GrahamCampbell\Markdown\Facades\Markdown; -use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Routing\Controller; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\View; @@ -29,8 +28,6 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; class SubscribeController extends Controller { - use DispatchesJobs; - /** * Show the subscribe by email page. * @@ -52,7 +49,7 @@ class SubscribeController extends Controller $email = Binput::get('email'); try { - $this->dispatch(new SubscribeSubscriberCommand($email)); + dispatch(new SubscribeSubscriberCommand($email)); } catch (AlreadySubscribedException $e) { return Redirect::route('subscribe.subscribe') ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('cachet.subscriber.email.failure'))) @@ -87,7 +84,7 @@ class SubscribeController extends Controller throw new BadRequestHttpException(); } - $this->dispatch(new VerifySubscriberCommand($subscriber)); + dispatch(new VerifySubscriberCommand($subscriber)); return Redirect::route('status-page') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('cachet.subscriber.email.verified'))); @@ -112,7 +109,7 @@ class SubscribeController extends Controller throw new BadRequestHttpException(); } - $this->dispatch(new UnsubscribeSubscriberCommand($subscriber)); + dispatch(new UnsubscribeSubscriberCommand($subscriber)); return Redirect::route('status-page') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('cachet.subscriber.email.unsubscribed'))); From c026adb9d66712ac61e1022c3846af24251f5763 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Thu, 24 Dec 2015 15:28:21 +0000 Subject: [PATCH 3/4] Bumped min proxy version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3b8c8df4c..65145212c 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "alt-three/validator": "^1.4", "barryvdh/laravel-cors": "^0.7", "doctrine/dbal": "^2.5", - "fideloper/proxy": "^3.0", + "fideloper/proxy": "^3.1", "graham-campbell/binput": "^3.3", "graham-campbell/core": "^4.2", "graham-campbell/markdown": "^5.3", From 7ff9147b304396e72bc3df225ea9f55784687d1b Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Thu, 24 Dec 2015 15:34:45 +0000 Subject: [PATCH 4/4] Updated dependencies --- composer.lock | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/composer.lock b/composer.lock index 897f0ae8d..81c0b94d4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "40ead365cbc5479b0d518891503a56d5", - "content-hash": "1e0a5483b39ca2ec40856079036a4c13", + "hash": "2af403fbb9568e4db94c2d9eb8b00e6f", + "content-hash": "8a51b88ff61aa51581943bbf535a48d1", "packages": [ { "name": "alt-three/emoji", @@ -931,16 +931,16 @@ }, { "name": "fideloper/proxy", - "version": "3.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/fideloper/TrustedProxy.git", - "reference": "cc7937c3b4e285e24e020beeaff331180a641e6d" + "reference": "ec4dd30141e2515e307aea3539ff242e85c3f120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/cc7937c3b4e285e24e020beeaff331180a641e6d", - "reference": "cc7937c3b4e285e24e020beeaff331180a641e6d", + "url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/ec4dd30141e2515e307aea3539ff242e85c3f120", + "reference": "ec4dd30141e2515e307aea3539ff242e85c3f120", "shasum": "" }, "require": { @@ -954,7 +954,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -978,7 +978,7 @@ "proxy", "trusted proxy" ], - "time": "2015-02-04 20:24:17" + "time": "2015-12-24 15:02:55" }, { "name": "graham-campbell/binput", @@ -1726,16 +1726,16 @@ }, { "name": "laravel/framework", - "version": "v5.1.27", + "version": "5.1.x-dev", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "b16f80878fd3603022d3c84593397cedd9af0bcf" + "reference": "5be7f261e8a2f03d6fa6be99eb79e261a880421d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/b16f80878fd3603022d3c84593397cedd9af0bcf", - "reference": "b16f80878fd3603022d3c84593397cedd9af0bcf", + "url": "https://api.github.com/repos/laravel/framework/zipball/5be7f261e8a2f03d6fa6be99eb79e261a880421d", + "reference": "5be7f261e8a2f03d6fa6be99eb79e261a880421d", "shasum": "" }, "require": { @@ -1850,7 +1850,7 @@ "framework", "laravel" ], - "time": "2015-12-17 20:35:38" + "time": "2015-12-24 15:05:06" }, { "name": "league/commonmark",