Passed
Push — master ( 9201fc...2305dc )
by Hamzah
08:36 queued 05:30
created
src/Bases/Contract.php 1 patch
Doc Comments   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -26,30 +26,30 @@  discard block
 block discarded – undo
26 26
     /**
27 27
      * @param array $data
28 28
      *
29
-     * @return mixed
29
+     * @return boolean
30 30
      */
31 31
     public function insert($data = []);
32 32
 
33 33
     /**
34 34
      * @param array $data
35
-     * @param $entityId
35
+     * @param integer $entityId
36 36
      *
37 37
      * @return bool
38 38
      */
39 39
     public function update($entityId, $data = []);
40 40
 
41 41
     /**
42
-     * @param $entityId
42
+     * @param integer $entityId
43 43
      *
44
-     * @return mixed
44
+     * @return boolean
45 45
      */
46 46
     public function delete($entityId);
47 47
 
48 48
     /**
49
-     * @param $entityId
49
+     * @param integer $entityId
50 50
      * @param array $columns
51 51
      *
52
-     * @return mixed
52
+     * @return Entity
53 53
      */
54 54
     public function find($entityId, $columns = ['*']);
55 55
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      * @param array $filters
58 58
      * @param array $columns
59 59
      *
60
-     * @return mixed
60
+     * @return Entity
61 61
      */
62 62
     public function findBy($filters = [], $columns = ['*']);
63 63
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      * @param int $limit
74 74
      * @param array $filters
75 75
      *
76
-     * @return Paginator
76
+     * @return \Illuminate\Contracts\Pagination\Paginator
77 77
      */
78 78
     public function simplePaginate($limit = 10, $filters = []);
79 79
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
      * @param array $filter
98 98
      * @param array $columns
99 99
      *
100
-     * @return mixed
100
+     * @return Entity
101 101
      */
102 102
     public function first($filter = [], $columns = ['*']);
103 103
 
@@ -140,13 +140,13 @@  discard block
 block discarded – undo
140 140
 
141 141
     /**
142 142
      * @param int $entityId
143
-     * @return mixed
143
+     * @return boolean|null
144 144
      */
145 145
     public function restore($entityId = 0);
146 146
 
147 147
     /**
148 148
      * @param int $categoryId
149
-     * @return mixed
149
+     * @return boolean|null
150 150
      */
151 151
     public function forceDelete($categoryId = 0);
152 152
 }
Please login to merge, or discard this patch.
src/Bases/Controller.php 2 patches
Doc Comments   -2 removed lines patch added patch discarded remove patch
@@ -96,7 +96,6 @@  discard block
 block discarded – undo
96 96
     /**
97 97
      * Display a listing of the resource.
98 98
      *
99
-     * @param Request $request
100 99
      *
101 100
      * @return \Illuminate\Http\Response
102 101
      */
@@ -249,7 +248,6 @@  discard block
 block discarded – undo
249 248
     /**
250 249
      * Update the specified resource in storage.
251 250
      *
252
-     * @param \Illuminate\Http\Request $request
253 251
      * @param int                      $entityId
254 252
      *
255 253
      * @return \Illuminate\Http\RedirectResponse
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         $this->breadcrumbs = new Collection();
59 59
 
60 60
         $language = $request->header('Language', 'en');
61
-        if (! in_array($language, \Config::get('app.locales'))) {
61
+        if (!in_array($language, \Config::get('app.locales'))) {
62 62
             $language = 'en';
63 63
         }
64 64
         $limit = $request->get('limit', 10);
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
         $this->interface = $interface;
82 82
         $this->isAPI = $request->expectsJson();
83 83
 
84
-        if (! $this->isAPI) {
84
+        if (!$this->isAPI) {
85 85
             $this->breadcrumbs = new Collection();
86 86
             $this->search = new Collection();
87
-            \View::share('pageTitle', $this->pageTitle.' | '.\Config::get('app.name'));
87
+            \View::share('pageTitle', $this->pageTitle . ' | ' . \Config::get('app.name'));
88 88
             \View::share('breadcrumbs', $this->breadcrumbs);
89 89
             \View::share('menu', $this->menu);
90 90
             \View::share('search', $this->search);
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
     public function index()
104 104
     {
105 105
         $data = $this->interface->simplePaginate($this->limit, $this->request->all());
106
-        if (! $this->isAPI) {
107
-            \View::share('pageTitle', 'List '.$this->pageTitle.' | '.\Config::get('app.name'));
106
+        if (!$this->isAPI) {
107
+            \View::share('pageTitle', 'List ' . $this->pageTitle . ' | ' . \Config::get('app.name'));
108 108
             $this->breadcrumbs->put('index', [
109 109
                 'link' => $this->routeIndex,
110 110
                 'text' => $this->pageTitle,
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
      */
136 136
     public function create()
137 137
     {
138
-        if (! $this->isAPI) {
139
-            \View::share('pageTitle', 'Create '.$this->pageTitle.' | '.\Config::get('app.name'));
138
+        if (!$this->isAPI) {
139
+            \View::share('pageTitle', 'Create ' . $this->pageTitle . ' | ' . \Config::get('app.name'));
140 140
             $this->breadcrumbs->put('create', [
141 141
                 'link' => $this->createRoute,
142 142
                 'text' => trans('common/others.create'),
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     public function baseStore()
157 157
     {
158 158
         $entity = $this->interface->create($this->request->except(['_token', '_method']));
159
-        if (! $this->isAPI) {
159
+        if (!$this->isAPI) {
160 160
             if ($entity) {
161 161
                 return \Redirect::to($this->routeIndex)->with('message', __('messages.success'));
162 162
             }
@@ -187,11 +187,11 @@  discard block
 block discarded – undo
187 187
     public function show($entityId)
188 188
     {
189 189
         $entity = $this->interface->find($entityId);
190
-        if (! $this->isAPI) {
191
-            if (! $entity) {
190
+        if (!$this->isAPI) {
191
+            if (!$entity) {
192 192
                 return \Redirect::to($this->routeIndex)->with('warning', __('messages.not_found'));
193 193
             }
194
-            \View::share('pageTitle', 'View '.$this->pageTitle.' | '.\Config::get('app.name'));
194
+            \View::share('pageTitle', 'View ' . $this->pageTitle . ' | ' . \Config::get('app.name'));
195 195
             $this->breadcrumbs->put('view', [
196 196
                 'link' => '',
197 197
                 'text' => $entity->name ?? $entity->title ?? __('messages.view'),
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
                 ->with('notes', $this->interface->notes($entityId))
204 204
                 ->with('files', $this->interface->files($entityId));
205 205
         }
206
-        if (! $entity) {
206
+        if (!$entity) {
207 207
             return response()->json(null, JsonResponse::HTTP_NOT_FOUND);
208 208
         }
209 209
 
@@ -223,8 +223,8 @@  discard block
 block discarded – undo
223 223
     public function edit($entityId)
224 224
     {
225 225
         $entity = $this->interface->find($entityId);
226
-        if (! $this->isAPI) {
227
-            if (! $entity) {
226
+        if (!$this->isAPI) {
227
+            if (!$entity) {
228 228
                 return \Redirect::to($this->routeIndex)->with('warning', __('messages.not_found'));
229 229
             }
230 230
             $this->breadcrumbs->put('edit', [
@@ -263,8 +263,8 @@  discard block
 block discarded – undo
263 263
             $saved = $this->interface->update($entityId, $this->request->except(['_token', '_method']));
264 264
         }
265 265
 
266
-        if (! $this->isAPI) {
267
-            if (! $entity) {
266
+        if (!$this->isAPI) {
267
+            if (!$entity) {
268 268
                 return \Redirect::to($this->routeIndex)->with('warning', __('messages.not_found'));
269 269
             }
270 270
 
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
             return \Redirect::to($this->routeIndex)->with('error', __('messages.not_modified'));
276 276
         }
277 277
 
278
-        if (! $entity) {
278
+        if (!$entity) {
279 279
             return response()->json(null, JsonResponse::HTTP_NOT_FOUND);
280 280
         }
281 281
 
@@ -304,8 +304,8 @@  discard block
 block discarded – undo
304 304
         if ($entity) {
305 305
             $deleted = $this->interface->delete($entityId);
306 306
         }
307
-        if (! $this->isAPI) {
308
-            if (! $entity) {
307
+        if (!$this->isAPI) {
308
+            if (!$entity) {
309 309
                 return \Redirect::to($this->routeIndex)->with('warning', __('messages.not_found'));
310 310
             }
311 311
             if ($deleted) {
@@ -336,8 +336,8 @@  discard block
 block discarded – undo
336 336
     {
337 337
         $entity = $this->interface->restore($entityId);
338 338
 
339
-        if (! $this->isAPI) {
340
-            if (! $entity) {
339
+        if (!$this->isAPI) {
340
+            if (!$entity) {
341 341
                 return \Redirect::to($this->routeIndex)->with('warning', __('messages.not_found'));
342 342
             }
343 343
             if ($entity) {
@@ -369,8 +369,8 @@  discard block
 block discarded – undo
369 369
     {
370 370
         $entity = $this->interface->forceDelete($entityId);
371 371
 
372
-        if (! $this->isAPI) {
373
-            if (! $entity) {
372
+        if (!$this->isAPI) {
373
+            if (!$entity) {
374 374
                 return \Redirect::to($this->routeIndex)->with('warning', __('messages.not_found'));
375 375
             }
376 376
             if ($entity) {
Please login to merge, or discard this patch.
src/config/repository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
  * Time: 09:58 ص
7 7
  */
8 8
 return [
9
-    'app_path' => realpath(__DIR__.'/../app/'),
9
+    'app_path' => realpath(__DIR__ . '/../app/'),
10 10
     'route_path' => realpath('routes/'),
11 11
     'resources_path' => realpath('resources/'),
12 12
 
Please login to merge, or discard this patch.
src/GeneratorServiceProvider.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,13 +26,13 @@
 block discarded – undo
26 26
         }
27 27
 
28 28
         $this->publishes([
29
-            __DIR__.'/config' => realpath('config'),
30
-        ],'repository-config');
29
+            __DIR__ . '/config' => realpath('config'),
30
+        ], 'repository-config');
31 31
         
32
-        $this->mergeConfigFrom(__DIR__.'/config/repository.php', 'repository-generator');
32
+        $this->mergeConfigFrom(__DIR__ . '/config/repository.php', 'repository-generator');
33 33
         $this->publishes([
34
-            __DIR__.'/stubs' => \Config::get('repository.resources_path',realpath(__DIR__.'/../../../../resources/'))."/stubs/",
35
-        ],'repository-stub');
34
+            __DIR__ . '/stubs' => \Config::get('repository.resources_path', realpath(__DIR__ . '/../../../../resources/')) . "/stubs/",
35
+        ], 'repository-stub');
36 36
     }
37 37
 
38 38
     /**
Please login to merge, or discard this patch.
src/Bases/Requests.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,14 +29,14 @@
 block discarded – undo
29 29
     protected function failedValidation(Validator $validator)
30 30
     {
31 31
 
32
-        if (strpos($this->path(),'api') !== false) {
32
+        if (strpos($this->path(), 'api') !== false) {
33 33
             $errors = (new ValidationException($validator))->errors();
34 34
             throw new HttpResponseException(response()->json(['success' => false, 'errors' => $errors,
35 35
             ], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
36 36
         }
37 37
     }
38 38
 
39
-    public function rules(){
40
-        \App::setLocale($this->header('Language','en'));
39
+    public function rules() {
40
+        \App::setLocale($this->header('Language', 'en'));
41 41
     }
42 42
 }
Please login to merge, or discard this patch.
src/Commands/Generator.php 2 patches
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,6 @@
 block discarded – undo
51 51
     /**
52 52
      * Execute the console command.
53 53
      *
54
-
55 54
      */
56 55
     public function handle()
57 56
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
     public function handle()
57 57
     {
58 58
 
59
-        $file = explode("/", (string)$this->argument('name'));
59
+        $file = explode("/", (string) $this->argument('name'));
60 60
 
61 61
         $this->repoName = $file[count($file) - 1];
62 62
         unset($file[count($file) - 1]);
Please login to merge, or discard this patch.