| 1 | <?php  | 
            ||
| 13 | class Parser implements ParserInterface  | 
            ||
| 14 | { | 
            ||
| 15 | /**  | 
            ||
| 16 | * Constructor  | 
            ||
| 17 | *  | 
            ||
| 18 | * @param Postcode $postcode  | 
            ||
| 19 | */  | 
            ||
| 20 | public function __construct(Postcode $postcode)  | 
            ||
| 24 | |||
| 25 | /**  | 
            ||
| 26 | * @return string $outward  | 
            ||
| 27 | */  | 
            ||
| 28 |     public function outward() {} | 
            ||
| 29 | |||
| 30 | /**  | 
            ||
| 31 | * @return string $inward  | 
            ||
| 32 | */  | 
            ||
| 33 |     public function inward() {} | 
            ||
| 34 | |||
| 35 | /**  | 
            ||
| 36 | * @return string $district  | 
            ||
| 37 | */  | 
            ||
| 38 |     public function district() {} | 
            ||
| 39 | |||
| 40 | /**  | 
            ||
| 41 | * @return string $area  | 
            ||
| 42 | */  | 
            ||
| 43 |     public function area() {} | 
            ||
| 44 | |||
| 45 | /**  | 
            ||
| 46 | * @return string $unit  | 
            ||
| 47 | */  | 
            ||
| 48 |     public function unit() {} | 
            ||
| 49 | |||
| 50 | /**  | 
            ||
| 51 | * @return array  | 
            ||
| 52 | */  | 
            ||
| 53 |     public function parse() {} | 
            ||
| 54 | }  | 
            ||
| 55 | 
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: