Conditions | 4 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
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 | |||
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.