| 1 | <?php |
||
| 11 | class Update implements Query |
||
| 12 | { |
||
| 13 | use |
||
| 14 | EscaperAware, |
||
| 15 | Builders\Join, |
||
| 16 | Builders\Where, |
||
| 17 | Builders\OrderBy, |
||
| 18 | Builders\Limit; |
||
| 19 | |||
| 20 | private |
||
| 21 | $updatePart, |
||
|
1 ignored issue
–
show
|
|||
| 22 | $sets; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param Snippets\TableName|string|null $table |
||
| 26 | */ |
||
| 27 | 6 | public function __construct($table = null, ?string $alias = null) |
|
| 39 | |||
| 40 | 6 | public function toString(): string |
|
| 53 | |||
| 54 | /** |
||
| 55 | * @param Snippets\TableName|string $table |
||
| 56 | */ |
||
| 57 | 5 | public function update($table, ?string $alias = null): self |
|
| 63 | |||
| 64 | 6 | public function set(array $fields): self |
|
| 70 | |||
| 71 | 6 | private function buildUpdate(): string |
|
| 82 | |||
| 83 | 5 | private function buildSets(): string |
|
| 89 | } |
||
| 90 |
Only declaring a single property per statement allows you to later on add doc comments more easily.
It is also recommended by PSR2, so it is a common style that many people expect.