@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | { |
28 | 28 | $routeName = 'admin.form.element.'.static::$route; |
29 | 29 | |
30 | - if (! $router->has($routeName)) { |
|
30 | + if (!$router->has($routeName)) { |
|
31 | 31 | $router->post('{adminModel}/'.static::$route.'/{field}/{id?}', [ |
32 | 32 | 'as' => $routeName, |
33 | 33 | 'uses' => 'SleepingOwl\Admin\Http\Controllers\UploadController@fromField', |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function getUploadPath(UploadedFile $file) |
129 | 129 | { |
130 | - if (! is_callable($this->uploadPath)) { |
|
130 | + if (!is_callable($this->uploadPath)) { |
|
131 | 131 | return $this->defaultUploadPath($file); |
132 | 132 | } |
133 | 133 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | */ |
154 | 154 | public function getUploadFileName(UploadedFile $file) |
155 | 155 | { |
156 | - if (! is_callable($this->uploadFileName)) { |
|
156 | + if (!is_callable($this->uploadFileName)) { |
|
157 | 157 | return $this->defaultUploadFilename($file); |
158 | 158 | } |
159 | 159 |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function setClass($class) |
58 | 58 | { |
59 | - if (! class_exists($class)) { |
|
59 | + if (!class_exists($class)) { |
|
60 | 60 | throw new RepositoryException("Class {$class} not found."); |
61 | 61 | } |
62 | 62 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function with($with) |
105 | 105 | { |
106 | - if (! is_array($with)) { |
|
106 | + if (!is_array($with)) { |
|
107 | 107 | $with = func_get_args(); |
108 | 108 | } |
109 | 109 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function __construct($treeType = null) |
42 | 42 | { |
43 | - if (! is_null($treeType)) { |
|
43 | + if (!is_null($treeType)) { |
|
44 | 44 | $this->setTreeType($treeType); |
45 | 45 | } |
46 | 46 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | { |
55 | 55 | $this->treeType = new $treeType($this); |
56 | 56 | |
57 | - if (! ($this->treeType instanceof TreeTypeInterface)) { |
|
57 | + if (!($this->treeType instanceof TreeTypeInterface)) { |
|
58 | 58 | throw new DisplayTreeException('Tree type class must be instanced of [SleepingOwl\Admin\Contracts\Display\Tree\TreeTypeInterface]'); |
59 | 59 | } |
60 | 60 | } |
@@ -76,7 +76,7 @@ |
||
76 | 76 | /** |
77 | 77 | * Load Relations by this->name. |
78 | 78 | * @param Builder $query |
79 | - * @param $direction |
|
79 | + * @param string $direction |
|
80 | 80 | */ |
81 | 81 | protected function loadRelationOrder(Builder $query, $direction) |
82 | 82 | { |
@@ -107,7 +107,7 @@ |
||
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
110 | - * @return mixed |
|
110 | + * @return Badge|null |
|
111 | 111 | */ |
112 | 112 | public function getBadge() |
113 | 113 | { |
@@ -75,15 +75,15 @@ |
||
75 | 75 | { |
76 | 76 | $this->content = $content; |
77 | 77 | |
78 | - if (! is_null($label)) { |
|
78 | + if (!is_null($label)) { |
|
79 | 79 | $this->setLabel($label); |
80 | 80 | } |
81 | 81 | |
82 | - if (! is_null($icon)) { |
|
82 | + if (!is_null($icon)) { |
|
83 | 83 | $this->setIcon($icon); |
84 | 84 | } |
85 | 85 | |
86 | - if (! is_null($badge)) { |
|
86 | + if (!is_null($badge)) { |
|
87 | 87 | $this->setBadge($badge); |
88 | 88 | } |
89 | 89 |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
133 | - * @return string |
|
133 | + * @return integer |
|
134 | 134 | */ |
135 | 135 | public function getMaxDepth() |
136 | 136 | { |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | } |
361 | 361 | |
362 | 362 | /** |
363 | - * @param \Illuminate\Database\Eloquent\Builder|Builder $query |
|
363 | + * @param \Illuminate\Database\Eloquent\Builder $query |
|
364 | 364 | */ |
365 | 365 | protected function modifyQuery(\Illuminate\Database\Eloquent\Builder $query) |
366 | 366 | { |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | } |
369 | 369 | |
370 | 370 | /** |
371 | - * @return \Illuminate\Foundation\Application|mixed |
|
371 | + * @return TreeRepositoryInterface |
|
372 | 372 | * @throws \Exception |
373 | 373 | */ |
374 | 374 | protected function makeRepository() |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public static function registerRoutes(Router $router) |
24 | 24 | { |
25 | 25 | $routeName = 'admin.display.tree.reorder'; |
26 | - if (! $router->has($routeName)) { |
|
26 | + if (!$router->has($routeName)) { |
|
27 | 27 | $router->post('{adminModel}/reorder', |
28 | 28 | ['as' => $routeName, 'uses' => 'SleepingOwl\Admin\Http\Controllers\DisplayController@treeReorder']); |
29 | 29 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | if ($this->getParentField()) { |
119 | 119 | $repository = $repository->setParentField($this->getParentField()); |
120 | 120 | } |
121 | - if (! is_null($this->treeType)) { |
|
121 | + if (!is_null($this->treeType)) { |
|
122 | 122 | $repository->setTreeType($this->treeType); |
123 | 123 | } |
124 | 124 | |
@@ -340,11 +340,11 @@ discard block |
||
340 | 340 | */ |
341 | 341 | public function getCollection() |
342 | 342 | { |
343 | - if (! $this->isInitialized()) { |
|
343 | + if (!$this->isInitialized()) { |
|
344 | 344 | throw new \Exception('Display is not initialized'); |
345 | 345 | } |
346 | 346 | |
347 | - if (! is_null($this->collection)) { |
|
347 | + if (!is_null($this->collection)) { |
|
348 | 348 | return $this->collection; |
349 | 349 | } |
350 | 350 | |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | { |
376 | 376 | $repository = parent::makeRepository(); |
377 | 377 | |
378 | - if (! ($repository instanceof TreeRepositoryInterface)) { |
|
378 | + if (!($repository instanceof TreeRepositoryInterface)) { |
|
379 | 379 | throw new \Exception('Repository class must be instanced of [TreeRepositoryInterface]'); |
380 | 380 | } |
381 | 381 |
@@ -181,7 +181,7 @@ |
||
181 | 181 | } |
182 | 182 | |
183 | 183 | /** |
184 | - * @param mixed $defaultValue |
|
184 | + * @param string $defaultValue |
|
185 | 185 | * |
186 | 186 | * @return $this |
187 | 187 | */ |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | { |
86 | 86 | $name = array_shift($parts); |
87 | 87 | |
88 | - while (! empty($parts)) { |
|
88 | + while (!empty($parts)) { |
|
89 | 89 | $part = array_shift($parts); |
90 | 90 | $name .= "[$part]"; |
91 | 91 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | { |
239 | 239 | $this->addValidationRule('_unique'); |
240 | 240 | |
241 | - if (! is_null($message)) { |
|
241 | + if (!is_null($message)) { |
|
242 | 242 | $this->addValidationMessage('unique', $message); |
243 | 243 | } |
244 | 244 | |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | */ |
347 | 347 | public function getValueFromRequest(\Illuminate\Http\Request $request) |
348 | 348 | { |
349 | - if ($request->hasSession() && ! is_null($value = $request->old($this->getPath()))) { |
|
349 | + if ($request->hasSession() && !is_null($value = $request->old($this->getPath()))) { |
|
350 | 350 | return $value; |
351 | 351 | } |
352 | 352 | |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | */ |
359 | 359 | public function getValueFromModel() |
360 | 360 | { |
361 | - if (! is_null($value = $this->getValueFromRequest(request()))) { |
|
361 | + if (!is_null($value = $this->getValueFromRequest(request()))) { |
|
362 | 362 | return $value; |
363 | 363 | } |
364 | 364 | |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | $path = $this->getPath(); |
367 | 367 | $value = $this->getDefaultValue(); |
368 | 368 | |
369 | - if (is_null($model) || ! $model->exists) { |
|
369 | + if (is_null($model) || !$model->exists) { |
|
370 | 370 | return $value; |
371 | 371 | } |
372 | 372 | |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | if ($count === 1) { |
397 | 397 | $attribute = $model->getAttribute($this->getModelAttributeKey()); |
398 | 398 | |
399 | - if (! empty($attribute) || $attribute === 0 || is_null($value)) { |
|
399 | + if (!empty($attribute) || $attribute === 0 || is_null($value)) { |
|
400 | 400 | return $attribute; |
401 | 401 | } |
402 | 402 | } |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | if ($count === 2) { |
411 | 411 | $attribute = $model->getAttribute($relation); |
412 | 412 | |
413 | - if (! empty($attribute) || is_null($value)) { |
|
413 | + if (!empty($attribute) || is_null($value)) { |
|
414 | 414 | return $attribute; |
415 | 415 | } |
416 | 416 | } |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | */ |
205 | 205 | public function can($action, Model $model) |
206 | 206 | { |
207 | - if (! $this->checkAccess) { |
|
207 | + if (!$this->checkAccess) { |
|
208 | 208 | return true; |
209 | 209 | } |
210 | 210 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | */ |
217 | 217 | public function isCreatable() |
218 | 218 | { |
219 | - if (! is_callable($this->getCreate())) { |
|
219 | + if (!is_callable($this->getCreate())) { |
|
220 | 220 | return false; |
221 | 221 | } |
222 | 222 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | */ |
241 | 241 | public function isEditable(Model $model) |
242 | 242 | { |
243 | - if (! is_callable($this->getEdit())) { |
|
243 | + if (!is_callable($this->getEdit())) { |
|
244 | 244 | return false; |
245 | 245 | } |
246 | 246 | |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | */ |
364 | 364 | public function fireDisplay(array $payload = []) |
365 | 365 | { |
366 | - if (! is_callable($this->getDisplay())) { |
|
366 | + if (!is_callable($this->getDisplay())) { |
|
367 | 367 | return; |
368 | 368 | } |
369 | 369 | |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | */ |
410 | 410 | public function fireCreate() |
411 | 411 | { |
412 | - if (! is_callable($this->getCreate())) { |
|
412 | + if (!is_callable($this->getCreate())) { |
|
413 | 413 | return; |
414 | 414 | } |
415 | 415 | |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | */ |
457 | 457 | public function fireEdit($id) |
458 | 458 | { |
459 | - if (! is_callable($this->getEdit())) { |
|
459 | + if (!is_callable($this->getEdit())) { |
|
460 | 460 | return; |
461 | 461 | } |
462 | 462 |
@@ -108,6 +108,9 @@ |
||
108 | 108 | |
109 | 109 | protected $breadcrumbs = null; |
110 | 110 | |
111 | + /** |
|
112 | + * @param string $class |
|
113 | + */ |
|
111 | 114 | public function __construct(\Illuminate\Contracts\Foundation\Application $app, $class) |
112 | 115 | { |
113 | 116 | parent::__construct($app, $class); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function fireDisplay(array $payload = []) |
35 | 35 | { |
36 | - if (! method_exists($this, 'onDisplay')) { |
|
36 | + if (!method_exists($this, 'onDisplay')) { |
|
37 | 37 | return; |
38 | 38 | } |
39 | 39 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function fireCreate() |
58 | 58 | { |
59 | - if (! method_exists($this, 'onCreate')) { |
|
59 | + if (!method_exists($this, 'onCreate')) { |
|
60 | 60 | return; |
61 | 61 | } |
62 | 62 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function fireEdit($id) |
85 | 85 | { |
86 | - if (! method_exists($this, 'onEdit')) { |
|
86 | + if (!method_exists($this, 'onEdit')) { |
|
87 | 87 | return; |
88 | 88 | } |
89 | 89 |