| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 41 | public function areEqual($firstEntity, $secondEntity) |
||
| 42 | { |
||
| 43 | $entityDefinition = $this->definitions->getDefinition($firstEntity); |
||
| 44 | |||
| 45 | if (!$entityDefinition->fitsFor($secondEntity)) { |
||
| 46 | throw new InvalidArgumentException("You can't compare entities of different type."); |
||
| 47 | } |
||
| 48 | |||
| 49 | foreach ($entityDefinition->getObservedProperties() as $property) { |
||
| 50 | if ($this->propertyValueComparer->hasDifferentValue($property, $firstEntity, $secondEntity)) { |
||
| 51 | return false; |
||
| 52 | } |
||
| 53 | } |
||
| 54 | |||
| 55 | return true; |
||
| 56 | } |
||
| 57 | } |
||
| 58 |