1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Gewaer\Traits; |
||
6 | |||
7 | /** |
||
8 | * Trait ResponseTrait |
||
9 | * |
||
10 | * @package Gewaer\Traits |
||
11 | * |
||
12 | * @property Users $user |
||
13 | * @property Config $config |
||
14 | * @property Request $request |
||
15 | * @property Auth $auth |
||
16 | * @property \Phalcon\Di $di |
||
17 | * |
||
18 | */ |
||
19 | trait UsersAssociatedTrait |
||
20 | { |
||
21 | /** |
||
22 | * create new related User Associated instance dynamicly |
||
23 | * @param string $model |
||
24 | * @return voic |
||
0 ignored issues
–
show
|
|||
25 | * @todo Find a better way to handle namespaces for models |
||
26 | */ |
||
27 | 3 | public function saveUsersAssociatedModels(string $model): void |
|
28 | { |
||
29 | 3 | $class = '\Gewaer\Models\UsersAssociated' . ucfirst($model); |
|
30 | 3 | $usersAssociatedModel = new $class(); |
|
31 | 3 | $usersAssociatedModel->users_id = $this->user->getId(); |
|
32 | 3 | $usersAssociatedModel->companies_id = $this->getId(); |
|
33 | 3 | $usersAssociatedModel->apps_id = $this->di->getApp()->getId(); |
|
34 | 3 | $usersAssociatedModel->identify_id = $this->user->getId(); |
|
35 | 3 | $usersAssociatedModel->user_active = 1; |
|
36 | 3 | $usersAssociatedModel->user_role = 'admin'; |
|
37 | |||
38 | 3 | if (!$usersAssociatedModel->save()) { |
|
39 | throw new Exception((string)current($usersAssociatedModel->getMessages())); |
||
0 ignored issues
–
show
|
|||
40 | } |
||
41 | 3 | } |
|
42 | } |
||
43 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths