1 | <?php |
||
12 | abstract class AbstractJoin implements Join, Snippet, NeedTableAware |
||
13 | { |
||
14 | private |
||
15 | $table, |
||
|
|||
16 | $using, |
||
17 | $on; |
||
18 | |||
19 | 25 | public function __construct(string $table, ?string $alias = null) |
|
24 | |||
25 | /** |
||
26 | * @param array[string]|string $column |
||
27 | */ |
||
28 | 9 | public function using($column): self |
|
36 | |||
37 | 18 | public function on(?string $leftColumn, ?string $rightColumn): self |
|
44 | |||
45 | 25 | public function toString(): string |
|
58 | |||
59 | 2 | public function hasNeededTable(string $tableName): bool |
|
67 | |||
68 | abstract protected function getJoinDeclaration(): string; |
||
69 | |||
70 | 25 | private function buildUsingConditionClause(): string |
|
79 | |||
80 | 25 | private function buildOnConditionClause(): string |
|
94 | } |
||
95 |
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.