/**
  * Adding chained method responses into ShortifyPunit::ReturnValues
  *
  * @param $chainedMethodsBefore
  * @param $currentMethod
  * @param $action
  * @param $lastValue
  * @param $mockClassInstanceId
  */
 private function addChainedMethodResponse($chainedMethodsBefore, $currentMethod, $action, $lastValue, $mockClassInstanceId)
 {
     $response = [];
     $rResponse =& $response;
     $currentMethodName = key($currentMethod);
     foreach ($chainedMethodsBefore as $chainedMethod) {
         $chainedMethodName = key($chainedMethod);
         $chainedMethodArgs = $chainedMethod[$chainedMethodName];
         $serializedChainedMethodArgs = serialize($chainedMethodArgs);
         $rResponse[$chainedMethodName][$serializedChainedMethodArgs] = [];
         $rResponse =& $rResponse[$chainedMethodName][$serializedChainedMethodArgs];
     }
     $rResponse[$currentMethodName][serialize(current($currentMethod))] = ['response' => ['action' => $action, 'value' => $lastValue]];
     ShortifyPunit::addChainedResponse(array(get_class($this->mockClass) => [$mockClassInstanceId => $response]));
 }