| Conditions | 5 |
| Paths | 3 |
| Total Lines | 24 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | public function __invoke(ReflectionProperty $fromProperty, ReflectionProperty $toProperty) : Changes |
||
| 31 | { |
||
| 32 | if ($fromProperty->getDocComment() === '') { |
||
| 33 | return Changes::empty(); |
||
| 34 | } |
||
| 35 | |||
| 36 | $fromTypes = $fromProperty->getDocBlockTypeStrings(); |
||
| 37 | $toTypes = $toProperty->getDocBlockTypeStrings(); |
||
| 38 | |||
| 39 | sort($fromTypes); |
||
| 40 | sort($toTypes); |
||
| 41 | |||
| 42 | if ($fromTypes === $toTypes) { |
||
| 43 | return Changes::empty(); |
||
| 44 | } |
||
| 45 | |||
| 46 | return Changes::fromList(Change::changed( |
||
| 47 | sprintf( |
||
| 48 | 'Type documentation for property %s changed from %s to %s', |
||
| 49 | $this->formatProperty->__invoke($fromProperty), |
||
| 50 | implode('|', $fromTypes) ?: 'having no type', |
||
| 51 | implode('|', $toTypes) ?: 'having no type' |
||
| 52 | ), |
||
| 53 | true |
||
| 54 | )); |
||
| 57 |