public function invariantContract(MethodInvocation $invocation)
{
$object = $invocation->getThis();
$args = $this->fetchMethodArguments($invocation);
$class = $invocation->getMethod()->getDeclaringClass();
if ($class->isCloneable()) {
$args['__old'] = clone $object;
}
$result = $invocation->proceed();
$args['__result'] = $result;
$allContracts = $this->fetchAllContracts($class);
$this->ensureContracts($invocation, $allContracts, $object, $class->name, $args);
return $result;
}