| @@ 59-68 (lines=10) @@ | ||
| 56 | * @param $secondObject |
|
| 57 | * @throws InvalidArgumentException |
|
| 58 | */ |
|
| 59 | private function validaObjects($firstObject, $secondObject) |
|
| 60 | { |
|
| 61 | if (!is_object($firstObject) || !is_object($secondObject)) { |
|
| 62 | throw new InvalidArgumentException("Compared values need to be a valid objects."); |
|
| 63 | } |
|
| 64 | ||
| 65 | if (get_class($firstObject) !== get_class($secondObject)) { |
|
| 66 | throw new InvalidArgumentException("Compared values need to be an instances of the same class."); |
|
| 67 | } |
|
| 68 | } |
|
| 69 | } |
|
| 70 | ||
| @@ 74-83 (lines=10) @@ | ||
| 71 | * @param $secondObject |
|
| 72 | * @throws InvalidArgumentException |
|
| 73 | */ |
|
| 74 | private function validaObjects($firstObject, $secondObject) |
|
| 75 | { |
|
| 76 | if (!is_object($firstObject) || !is_object($secondObject)) { |
|
| 77 | throw new InvalidArgumentException("Compared values need to be a valid objects."); |
|
| 78 | } |
|
| 79 | ||
| 80 | if (get_class($firstObject) !== get_class($secondObject)) { |
|
| 81 | throw new InvalidArgumentException("Compared values need to be an instances of the same class."); |
|
| 82 | } |
|
| 83 | } |
|
| 84 | } |
|
| 85 | ||