1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of the Ocrend Framewok 3 package. |
||
5 | * |
||
6 | * (c) Ocrend Software <[email protected]> |
||
7 | * |
||
8 | * For the full copyright and license information, please view the LICENSE |
||
9 | * file that was distributed with this source code. |
||
10 | */ |
||
11 | |||
12 | namespace Ocrend\Kernel\Models\Traits; |
||
13 | |||
14 | use Ocrend\Kernel\Database\Database; |
||
15 | |||
16 | /** |
||
17 | * Añade características a un modelo para que pueda conectarse a una base de datos. |
||
18 | * |
||
19 | * @author Brayan Narváez <[email protected]> |
||
20 | */ |
||
21 | |||
22 | trait DBModel { |
||
23 | |||
24 | /** |
||
25 | * Tiene la instancia de la base de datos actual |
||
26 | * |
||
27 | * @var null|Mysql|Sqlite; |
||
0 ignored issues
–
show
The type
Ocrend\Kernel\Models\Traits\Mysql was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths
Loading history...
|
|||
28 | */ |
||
29 | protected $db = null; |
||
30 | |||
31 | /** |
||
32 | * Constructor inicial del modelo. |
||
33 | * Arranca la base de datos |
||
34 | * |
||
35 | * @param $driver : Driver para establecer la conexión de este modelo |
||
36 | * |
||
37 | * @return void |
||
38 | */ |
||
39 | protected function startDBConexion($driver = null) { |
||
40 | global $config; |
||
41 | $this->db = Database::resolveDriver($driver ?? $config['database']['default_driver']); |
||
0 ignored issues
–
show
It seems like
Ocrend\Kernel\Database\D...se']['default_driver']) of type Ocrend\Kernel\Database\Drivers\Mysql\Mysql or Ocrend\Kernel\Database\Drivers\Sqlite\Sqlite is incompatible with the declared type Ocrend\Kernel\Models\Tra...el\Models\Traits\Sqlite of property $db .
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property. Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
Loading history...
|
|||
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