| 1 | <?php |
||
| 7 | class PDOConnector implements Connector |
||
| 8 | { |
||
| 9 | public function __construct(PDO $pdo) |
||
| 13 | |||
| 14 | public static function make(array $configs): PDOConnector |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param string $sql |
||
| 29 | * |
||
| 30 | * @return mixed whatever the actual implementation returns, depending on the connector |
||
| 31 | */ |
||
| 32 | public function exec(string $sql) |
||
| 36 | } |
||
| 37 | |||
| 38 |
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: