| 1 | <?php |
||
| 24 | class DBQuery{ |
||
| 25 | |||
| 26 | const DIALECTS = [ |
||
| 27 | 'mysql' => 'MySQL', |
||
| 28 | 'pgsql' => 'Postgres', |
||
| 29 | 'sqlite' => 'SQLite', |
||
| 30 | 'firebird' => 'Firebird', |
||
| 31 | ]; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var \chillerlan\Database\Drivers\DBDriverInterface |
||
| 35 | */ |
||
| 36 | protected $DBDriver; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @var string |
||
| 40 | */ |
||
| 41 | protected $dialect; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * DBQuery constructor. |
||
| 45 | * |
||
| 46 | * @param \chillerlan\Database\Drivers\DBDriverInterface $DBDriver |
||
| 47 | */ |
||
| 48 | public function __construct(DBDriverInterface $DBDriver){ |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @param string $name |
||
| 56 | * |
||
| 57 | * @return \chillerlan\Database\Query\StatementInterface|null |
||
| 58 | */ |
||
| 59 | public function __get(string $name){ |
||
| 69 | |||
| 70 | } |
||
| 71 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: