1 | <?php |
||
11 | class PdoSqliteAdapter extends GenericPdo implements AdapterInterface |
||
12 | { |
||
13 | |||
14 | /** |
||
15 | * |
||
16 | * @var \PDO |
||
17 | */ |
||
18 | protected $resource; |
||
19 | |||
20 | |||
21 | /** |
||
22 | * Constructor |
||
23 | * |
||
24 | * @throws Exception\InvalidArgumentException |
||
25 | * @throws Exception\RuntimeException |
||
26 | * @param \PDO $resource |
||
27 | */ |
||
28 | 5 | public function __construct(PDO $resource) |
|
38 | |||
39 | |||
40 | /** |
||
41 | * {@inheritdoc} |
||
42 | * @return PdoSqliteConnection |
||
43 | */ |
||
44 | 2 | public function getConnection() { |
|
47 | |||
48 | } |
||
49 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: