Passed
Branch master (828252)
by Omar El
04:00
created
app/Http/Middleware/Authorize.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@
 block discarded – undo
11 11
      * @param  \Closure  $next
12 12
      * @return mixed
13 13
      */
14
-    public function handle($request, Closure $next, $controller){
14
+    public function handle($request, Closure $next, $controller) {
15 15
 
16 16
         $controller = new $controller();
17 17
 
18
-        if(!$controller->isAuthorized($request)){
18
+        if (!$controller->isAuthorized($request)) {
19 19
             return $controller->error("You aren't allowed to perform the requested action", 403);
20 20
         }
21 21
 
Please login to merge, or discard this patch.
app/Http/Controllers/CommentController.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -4,20 +4,20 @@
 block discarded – undo
4 4
 
5 5
 class CommentController extends Controller{
6 6
 
7
-	public function index(){
7
+    public function index(){
8 8
 		
9
-		$comments = Comment::all();
10
-		return $this->success($comments, 200);
11
-	}
9
+        $comments = Comment::all();
10
+        return $this->success($comments, 200);
11
+    }
12 12
 
13
-	public function show($id){
13
+    public function show($id){
14 14
 
15
-		$comment = Comment::find($id);
15
+        $comment = Comment::find($id);
16 16
 
17
-		if(!$comment){
18
-			return $this->error("The comment with {$id} doesn't exist", 404);
19
-		}
17
+        if(!$comment){
18
+            return $this->error("The comment with {$id} doesn't exist", 404);
19
+        }
20 20
 
21
-		return $this->success($comment, 200);
22
-	}
21
+        return $this->success($comment, 200);
22
+    }
23 23
 }
24 24
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,19 +2,19 @@
 block discarded – undo
2 2
 
3 3
 use App\Comment;
4 4
 
5
-class CommentController extends Controller{
5
+class CommentController extends Controller {
6 6
 
7
-	public function index(){
7
+	public function index() {
8 8
 		
9 9
 		$comments = Comment::all();
10 10
 		return $this->success($comments, 200);
11 11
 	}
12 12
 
13
-	public function show($id){
13
+	public function show($id) {
14 14
 
15 15
 		$comment = Comment::find($id);
16 16
 
17
-		if(!$comment){
17
+		if (!$comment) {
18 18
 			return $this->error("The comment with {$id} doesn't exist", 404);
19 19
 		}
20 20
 
Please login to merge, or discard this patch.
app/Http/routes.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 
14 14
 // Home Page
15 15
 $app->get('/', function () use ($app){
16
-	return $app->version();
16
+    return $app->version();
17 17
 });
18 18
 
19 19
 // Posts
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,14 +12,14 @@
 block discarded – undo
12 12
 */
13 13
 
14 14
 // Home Page
15
-$app->get('/', function () use ($app){
15
+$app->get('/', function() use ($app){
16 16
 	return $app->version();
17 17
 });
18 18
 
19 19
 // Posts
20
-$app->get('/posts','PostController@index');
21
-$app->post('/posts','PostController@store');
22
-$app->get('/posts/{post_id}','PostController@show');
20
+$app->get('/posts', 'PostController@index');
21
+$app->post('/posts', 'PostController@store');
22
+$app->get('/posts/{post_id}', 'PostController@show');
23 23
 $app->put('/posts/{post_id}', 'PostController@update');
24 24
 $app->patch('/posts/{post_id}', 'PostController@update');
25 25
 $app->delete('/posts/{post_id}', 'PostController@destroy');
Please login to merge, or discard this patch.