Exemplo n.º 1
0
 /**
  * Get the method data for the given user id.
  *
  * @param MethodInterface $method
  * @param string          $userId
  *
  * @return array
  */
 private function getMethodData(MethodInterface $method, $userId)
 {
     $data = $method->getArguments();
     $data['action'] = $method->getName();
     $data['secret'] = $this->getWriteKey();
     // Don't overwrite the userId if it it is present.
     if (!isset($data['userId']) && !isset($data['from'])) {
         $data['userId'] = $userId;
     }
     return $data;
 }
Exemplo n.º 2
0
 /**
  * Renders the method arguments.
  *
  * @param MethodInterface $method
  *
  * @return string
  */
 private function renderArguments(MethodInterface $method)
 {
     return implode(',', array_map(array($this, 'renderArgument'), $method->getArguments()));
 }