| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | public function convert(Address $customerAddress) |
||
| 42 | { |
||
| 43 | $contactAddress = new ContactAddress(); |
||
| 44 | foreach ($this->baseAddressProperties as $property) { |
||
| 45 | $this->accessor->setValue( |
||
| 46 | $contactAddress, |
||
| 47 | $property, |
||
| 48 | $this->accessor->getValue($customerAddress, $property) |
||
| 49 | ); |
||
| 50 | } |
||
| 51 | |||
| 52 | return $contactAddress; |
||
| 53 | } |
||
| 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: