src/Client/Commands/LogCommand.php
public function body(CryptographyEngine $cryptographyEngine)
	{
		$body = array(
			'hash' => $cryptographyEngine->hash($this->email),
			'action' => $this->action,
		);

		if ( ! empty($this->scope))
			$body['scope'] = $this->scope;

		if ( ! empty($this->data))
			$body['data'] = $cryptographyEngine->encrypt(json_encode($this->data), $this->email);

		//  add overwriting data when possible
		if ( ! empty($this->ip))
			$body['ip'] = $this->ip;

		if ( ! empty($this->useragent))
			$body['useragent'] = $this->useragent;

		if ( ! empty($this->created_at))
			$body['created_at'] = $this->created_at;

		return json_encode($body);
	}
public function body(CryptographyEngine $cryptographyEngine)
	{
		$body = array(
			'hash' => $cryptographyEngine->hash($this->email),
			'action' => $this->action,
		);

		if ( ! empty($this->scope))
			$body['scope'] = $this->scope;

		if ( ! empty($this->data))
			$body['data'] = $cryptographyEngine->encrypt(json_encode($this->data), $this->email);

		//  add overwriting data when possible
		if ( ! empty($this->ip))
			$body['ip'] = $this->ip;

		if ( ! empty($this->useragent))
			$body['useragent'] = $this->useragent;

		if ( ! empty($this->created_at))
			$body['created_at'] = $this->created_at;

		return json_encode($body);
	}
public function body ( CryptographyEngine $ cryptographyEngine ) { $ body = array ( 'hash' => $ cryptographyEngine -> hash ( $ this -> email ) , 'action' => $ this -> action , ) ; if ( ! empty ( $ this -> scope ) ) $ body [ 'scope' ] = $ this -> scope ; if ( ! empty ( $ this -> data ) ) $ body [ 'data' ] = $ cryptographyEngine -> encrypt ( json_encode ( $ this -> data ) , $ this -> email ) ; //  add overwriting data when possible if ( ! empty ( $ this -> ip ) ) $ body [ 'ip' ] = $ this -> ip ; if ( ! empty ( $ this -> useragent ) ) $ body [ 'useragent' ] = $ this -> useragent ; if ( ! empty ( $ this -> created_at ) ) $ body [ 'created_at' ] = $ this -> created_at ; return json_encode ( $ body ) ; }
returns the body

hash: email will be hashed before requesting the server
action: action will be transmitted in plain text
scope: optional scope will be transmitted in plain text
data: optional data will be encrypted before requesting the server

@param CryptographyEngine $cryptographyEngine

@return array|\Guzzle\Http\EntityBodyInterface|null|resource|string
returns the body