| Conditions | 1 |
| Paths | 1 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | protected function updateAutoIncrement($driver, $table): void |
||
| 13 | { |
||
| 14 | $method = "update{$driver}AutoIncrement"; |
||
| 15 | |||
| 16 | // perform changes as a transaction to avoid |
||
| 17 | // borking the database in case of issues. |
||
| 18 | DB::transaction(function () use ($method, $table) { |
||
| 19 | $this->{$method}($table); |
||
| 20 | }); |
||
| 21 | } |
||
| 22 | |||
| 34 |
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: