1 | <?php |
||
2 | |||
3 | namespace Apps\Controller\Admin\Profile; |
||
4 | |||
5 | |||
6 | use Apps\Model\Admin\Profile\FormSettings; |
||
7 | use Ffcms\Core\App; |
||
8 | use Ffcms\Core\Arch\View; |
||
9 | use Ffcms\Core\Network\Request; |
||
10 | use Ffcms\Core\Network\Response; |
||
11 | |||
12 | /** |
||
13 | * Trait ActionSettings |
||
14 | * @package Apps\Controller\Admin\Profile |
||
15 | * @property Request $request |
||
16 | * @property Response $response |
||
17 | * @property View $view |
||
18 | */ |
||
19 | trait ActionSettings |
||
20 | { |
||
21 | /** |
||
22 | * Profile global settings action |
||
23 | * @return string|null |
||
24 | * @throws \Ffcms\Core\Exception\SyntaxException |
||
25 | */ |
||
26 | public function settings(): ?string |
||
27 | { |
||
28 | $model = new FormSettings($this->getConfigs()); |
||
29 | |||
30 | if ($model->send()) { |
||
31 | if ($model->validate()) { |
||
32 | $this->setConfigs($model->getAllProperties()); |
||
0 ignored issues
–
show
|
|||
33 | App::$Session->getFlashBag()->add('success', __('Settings is successful updated')); |
||
34 | $this->response->redirect('profile/index'); |
||
35 | } else { |
||
36 | App::$Session->getFlashBag()->add('error', __('Form validation is failed')); |
||
37 | } |
||
38 | } |
||
39 | |||
40 | return $this->view->render('profile/settings', [ |
||
41 | 'model' => $model |
||
42 | ]); |
||
43 | } |
||
44 | } |
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.