| 1 | <?php |
||
| 19 | class Line1D extends AbstractLine implements LineInterface { |
||
| 20 | /** |
||
| 21 | * @var float $length Line length property. |
||
| 22 | * @var float $width Line width property. |
||
| 23 | */ |
||
| 24 | protected $length, |
||
|
|
|||
| 25 | $width; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Method checks sent variable and throws LineException if it is not an Point1D instance. |
||
| 29 | * |
||
| 30 | * @param mixed $point Variable to check. |
||
| 31 | * @throws LineException If sent argument is not an Point1D instance. |
||
| 32 | */ |
||
| 33 | protected function checkPoint($point) |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Method counts length. |
||
| 42 | * |
||
| 43 | * return float Line length. |
||
| 44 | */ |
||
| 45 | protected function countLength() |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Line1D constructor. |
||
| 52 | * |
||
| 53 | * @param mixed $from First end of the line. |
||
| 54 | * @param mixed $to Second end of the line. |
||
| 55 | */ |
||
| 56 | public function __construct($from, $to) |
||
| 63 | } |
||
| 64 |
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.