| 1 | <?php |
||
| 18 | abstract class AbstractTarget implements TargetInterface |
||
| 19 | { |
||
| 20 | 3 | public function __construct($type, $id) |
|
| 26 | |||
| 27 | /** |
||
| 28 | * @return int |
||
| 29 | */ |
||
| 30 | public function getId() |
||
| 34 | |||
| 35 | /** |
||
| 36 | * {@inheritdoc} |
||
| 37 | */ |
||
| 38 | public function getType() |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @return string |
||
| 45 | */ |
||
| 46 | 2 | public function getUniqId() |
|
| 50 | |||
| 51 | /** |
||
| 52 | * @return bool |
||
| 53 | */ |
||
| 54 | 2 | public function equals(TargetInterface $other) |
|
| 58 | } |
||
| 59 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: