| Conditions | 4 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 41 | |||
| 42 | public function add($point) |
||
| 43 | { |
||
| 44 | if (filter_var($point, FILTER_VALIDATE_INT) && is_numeric($point)) { |
||
| 45 | $point = new Point($point); |
||
| 46 | } elseif (!Point::check($point)) { |
||
| 47 | throw new CreatorException('You can only add points to Creator object'); |
||
| 48 | } |
||
| 49 | |||
| 50 | $this->addPoint($point); |
||
| 51 | |||
| 52 | return $point; |
||
| 53 | } |
||
| 54 | |||
| 55 | public function get($id) |
||
| 56 | { |
||
| 78 |
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.