*
* The request must be in canonical format. Exceptions will be propagated out.
*
- * @param $apiRequest
+ * @param array $apiRequest
* @return array
* @throws \API_Exception
* @throws \Civi\API\Exception\NotImplementedException
}
/**
- * @param $apiRequest
+ * @param array $apiRequest
* @throws \API_Exception
*/
protected function validate($apiRequest) {
* The full description of the API request.
* @throws Exception\NotImplementedException
* @return array
- * Array(0 => ProviderInterface, 1 => array).
+ * A tuple with the provider-object and a revised apiRequest.
+ * Array(0 => ProviderInterface, 1 => array $apiRequest).
*/
public function resolve($apiRequest) {
/** @var ResolveEvent $resolveEvent */
* The API provider responsible for executing the request.
* @param array $apiRequest
* The full description of the API request.
- * @return mixed
+ * @return array
+ * The revised API request.
*/
public function prepare($apiProvider, $apiRequest) {
/** @var PrepareEvent $event */
* @param array $result
* The response to return to the client.
* @return mixed
+ * The revised $result.
*/
public function respond($apiProvider, $apiRequest, $result) {
/** @var RespondEvent $event */
}
}
- $data = civicrm_api3_create_error($msg, $data);
+ $data = \civicrm_api3_create_error($msg, $data);
if (isset($apiRequest['params']) && is_array($apiRequest['params']) && !empty($apiRequest['params']['api.has_parent'])) {
$errorCode = empty($data['error_code']) ? 'chained_api_failed' : $data['error_code'];