|
1 | | -<?php |
2 | | -namespace App\Http\Controllers; |
| 1 | +<?php namespace App\Http\Controllers; |
3 | 2 | /** |
4 | 3 | * Copyright 2018 OpenStack Foundation |
5 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -155,8 +154,7 @@ public function getAllBySummit($summit_id) |
155 | 154 | { |
156 | 155 |
|
157 | 156 | $summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id); |
158 | | - if (is_null($summit)) |
159 | | - return $this->error404(); |
| 157 | + if (is_null($summit)) return $this->error404(); |
160 | 158 |
|
161 | 159 | return $this->_getAll( |
162 | 160 | function () { |
@@ -292,8 +290,7 @@ public function getAllBySummitCSV($summit_id) |
292 | 290 | try { |
293 | 291 |
|
294 | 292 | $summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id); |
295 | | - if (is_null($summit)) |
296 | | - return $this->error404(); |
| 293 | + if (is_null($summit)) return $this->error404(); |
297 | 294 |
|
298 | 295 | $validation = Validator::make($values, $rules); |
299 | 296 |
|
@@ -330,8 +327,7 @@ public function getAllBySummitCSV($summit_id) |
330 | 327 | ]); |
331 | 328 | } |
332 | 329 |
|
333 | | - if (is_null($filter)) |
334 | | - $filter = new Filter(); |
| 330 | + if (is_null($filter)) $filter = new Filter(); |
335 | 331 |
|
336 | 332 | $filter->validate([ |
337 | 333 | 'class_name' => 'sometimes|string|in:'.join(",", SummitEventTypeConstants::$valid_class_names), |
@@ -570,8 +566,7 @@ public function addEventTypeBySummit($summit_id) |
570 | 566 | return $this->processRequest(function () use ($summit_id) { |
571 | 567 |
|
572 | 568 | $summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id); |
573 | | - if (is_null($summit)) |
574 | | - return $this->error404(); |
| 569 | + if (is_null($summit)) return $this->error404(); |
575 | 570 |
|
576 | 571 | $payload = $this->getJsonPayload(EventTypeValidationRulesFactory::build(Request::all())); |
577 | 572 |
|
@@ -647,8 +642,7 @@ public function updateEventTypeBySummit($summit_id, $event_type_id) |
647 | 642 | return $this->processRequest(function () use ($summit_id, $event_type_id) { |
648 | 643 |
|
649 | 644 | $summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id); |
650 | | - if (is_null($summit)) |
651 | | - return $this->error404(); |
| 645 | + if (is_null($summit)) return $this->error404(); |
652 | 646 |
|
653 | 647 | $payload = $this->getJsonPayload(EventTypeValidationRulesFactory::build(Request::all(), true)); |
654 | 648 |
|
@@ -718,8 +712,7 @@ public function deleteEventTypeBySummit($summit_id, $event_type_id) |
718 | 712 | return $this->processRequest(function () use ($summit_id, $event_type_id) { |
719 | 713 |
|
720 | 714 | $summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id); |
721 | | - if (is_null($summit)) |
722 | | - return $this->error404(); |
| 715 | + if (is_null($summit)) return $this->error404(); |
723 | 716 |
|
724 | 717 | $this->event_type_service->deleteEventType($summit, intval($event_type_id)); |
725 | 718 |
|
@@ -776,8 +769,7 @@ public function seedDefaultEventTypesBySummit($summit_id) |
776 | 769 | return $this->processRequest(function () use ($summit_id) { |
777 | 770 |
|
778 | 771 | $summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id); |
779 | | - if (is_null($summit)) |
780 | | - return $this->error404(); |
| 772 | + if (is_null($summit)) return $this->error404(); |
781 | 773 |
|
782 | 774 | $event_types = $this->event_type_service->seedDefaultEventTypes($summit); |
783 | 775 |
|
@@ -858,8 +850,7 @@ public function addSummitDocument($summit_id, $event_type_id, $document_id) |
858 | 850 | return $this->processRequest(function () use ($summit_id, $event_type_id, $document_id) { |
859 | 851 |
|
860 | 852 | $summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id); |
861 | | - if (is_null($summit)) |
862 | | - return $this->error404(); |
| 853 | + if (is_null($summit)) return $this->error404(); |
863 | 854 |
|
864 | 855 |
|
865 | 856 | $document = $this->event_type_service->addSummitDocumentToEventType |
@@ -948,8 +939,7 @@ public function removeSummitDocument($summit_id, $event_type_id, $document_id) |
948 | 939 | return $this->processRequest(function () use ($summit_id, $event_type_id, $document_id) { |
949 | 940 |
|
950 | 941 | $summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id); |
951 | | - if (is_null($summit)) |
952 | | - return $this->error404(); |
| 942 | + if (is_null($summit)) return $this->error404(); |
953 | 943 |
|
954 | 944 | $document = $this->event_type_service->removeSummitDocumentFromEventType |
955 | 945 | ( |
|
0 commit comments