1 | <?php |
||
9 | class TableName implements Snippet |
||
10 | { |
||
11 | private |
||
12 | $tableName, |
||
|
|||
13 | $alias; |
||
14 | |||
15 | 84 | public function __construct(?string $tableName, ?string $alias = null) |
|
26 | |||
27 | 73 | public function toString(): string |
|
36 | |||
37 | 9 | public function getName(): string |
|
41 | |||
42 | 4 | public function getAlias(): string |
|
46 | } |
||
47 |
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.