| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function createReferenceName($className, array $attributes = array()) |
||
| 15 | { |
||
| 16 | $className = join('', array_slice(explode('\\', $className), -1)); |
||
| 17 | $referenceId = reset($attributes); |
||
| 18 | $referenceName = $referenceId ? sprintf('%s:%s', $className, $referenceId) : $className; |
||
| 19 | |||
| 20 | return $this->generateUniqueReferenceName($referenceName); |
||
| 21 | } |
||
| 22 | |||
| 51 |
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: