Completed
Push — master ( 448263...1ff728 )
by Stéphan
21s
created
src/Http/Controllers/MockController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
      * @param $request Request
28 28
      * @throws \Illuminate\Validation\ValidationException
29 29
      */
30
-    public function _handleValidation($table, $method, $request){
30
+    public function _handleValidation($table, $method, $request) {
31 31
 
32
-        $validation = config("mock.entrypoints.".$table.".".$method."_validation");
32
+        $validation = config("mock.entrypoints." . $table . "." . $method . "_validation");
33 33
 
34
-        if (config("mock.force_json") || config("mock.entrypoints.".$table.".".$method."_force_json")) {
34
+        if (config("mock.force_json") || config("mock.entrypoints." . $table . "." . $method . "_force_json")) {
35 35
             $request->server->set('HTTP_ACCEPT', 'application/json');
36 36
             $request->headers = new HeaderBag($request->server->getHeaders());
37 37
         }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     {
61 61
         $this->_handleValidation($table, "index", $request);
62 62
 
63
-        $entity = config("mock.entrypoints.".$table);
63
+        $entity = config("mock.entrypoints." . $table);
64 64
 
65 65
         if ($entity) {
66 66
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
              */
70 70
             $data = factory($entity["class"], $entity["number"])->states($entity["states"])->make($entity["override"]);
71 71
 
72
-            $data = $data->map(function ($item, $key) {
72
+            $data = $data->map(function($item, $key) {
73 73
 
74 74
                 if (!$item["id"]) {
75 75
                     $item['id'] = $key + 1;
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             $currentPageItems = $itemCollection->slice(($currentPage * $perPage) - $perPage, $perPage)->values()->all();
121 121
 
122 122
             // Create our paginator and pass it to the view
123
-            $paginatedItems= new LengthAwarePaginator($currentPageItems , count($itemCollection), $perPage);
123
+            $paginatedItems = new LengthAwarePaginator($currentPageItems, count($itemCollection), $perPage);
124 124
 
125 125
             // set url path for generted links
126 126
             $paginatedItems->setPath($request->url());
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
     {
167 167
         $this->_handleValidation($table, "update", $request);
168 168
 
169
-        $folder = public_path(Mock::getPath() ."/". $table);
169
+        $folder = public_path(Mock::getPath() . "/" . $table);
170 170
 
171 171
         if (!is_dir($folder)) {
172 172
             \File::makeDirectory($folder, 493, true);
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
     {
195 195
         $this->_handleValidation($table, "view", $request);
196 196
 
197
-        $entity = config("mock.entrypoints.".$table);
197
+        $entity = config("mock.entrypoints." . $table);
198 198
 
199 199
         if ($entity) {
200 200
 
Please login to merge, or discard this patch.