Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3912518
D178.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D178.diff
View Options
diff --git a/app/Actions/ActionsReport.php b/app/Actions/ActionsReport.php
--- a/app/Actions/ActionsReport.php
+++ b/app/Actions/ActionsReport.php
@@ -2,8 +2,6 @@
namespace Nasqueron\Notifications\Actions;
-use Response;
-
class ActionsReport {
/**
* List of actions
@@ -89,23 +87,4 @@
public function __toString () {
return json_encode($this, JSON_PRETTY_PRINT);
}
-
- /**
- * Renders the report
- *
- * @return Illuminate\Http\Response
- */
- public function render () {
- return Response::json($this)
- ->setStatusCode($this->getResponseStatusCode());
- }
-
- /**
- * Determines the HTTP status code of the response
- *
- * @return int 200 if all is fine, 503 if an error is present
- */
- public function getResponseStatusCode () {
- return $this->containsError() ? 503 : 200;
- }
}
diff --git a/app/Http/Controllers/Gate/GateController.php b/app/Http/Controllers/Gate/GateController.php
--- a/app/Http/Controllers/Gate/GateController.php
+++ b/app/Http/Controllers/Gate/GateController.php
@@ -6,7 +6,9 @@
use Nasqueron\Notifications\Services;
use Nasqueron\Notifications\Http\Controllers\Controller;
+use App;
use Report;
+use Response;
use Storage;
/**
@@ -67,7 +69,10 @@
*/
protected function renderReport () {
if (Features::isEnabled('ActionsReport')) {
- return Report::render();
+ $report = App::make('report');
+ $statusCode = $report->containsError() ? 503 : 200;
+ return Response::json($report)
+ ->setStatusCode($statusCode);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 06:07 (21 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2307629
Default Alt Text
D178.diff (1 KB)
Attached To
Mode
D178: Refactor ActionsReport render operation
Attached
Detach File
Event Timeline
Log In to Comment