| Conditions | 3 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 11 | public function __construct($columnName, ?string $alias = null) |
|
| 19 | { |
||
| 20 | 11 | if((! $columnName instanceof Snippet) && empty($columnName)) |
|
| 21 | { |
||
| 22 | 2 | throw new \InvalidArgumentException('Empty column name.'); |
|
| 23 | } |
||
| 24 | |||
| 25 | 9 | $this->columnName = $columnName; |
|
| 26 | 9 | $this->alias = $alias; |
|
| 27 | 9 | } |
|
| 28 | |||
| 61 |
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.