| 1 | <?php |
||
| 9 | class OrderBy implements Snippet |
||
| 10 | { |
||
| 11 | const |
||
| 12 | ASC = 'ASC', |
||
| 13 | DESC = 'DESC'; |
||
| 14 | |||
| 15 | private |
||
| 16 | $orders; |
||
|
1 ignored issue
–
show
|
|||
| 17 | |||
| 18 | 45 | public function __construct() |
|
| 22 | |||
| 23 | 13 | public function addOrderBy(string $column, string $direction = self::ASC): void |
|
| 29 | |||
| 30 | 38 | public function toString(): string |
|
| 49 | |||
| 50 | 13 | private function validateDirection(string $direction): void |
|
| 59 | } |
||
| 60 |
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using
the property is implicitly global.
To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.