Merge pull request #11461 from mattwire/tax_calcs_on_edit_contribution
[civicrm-core.git] / Civi / API / Kernel.php
index 3571201d80cee785473814d57b761e404f1c35c9..022de94f5a785cd4b8e7b95a04b646d6943c3783 100644 (file)
@@ -153,7 +153,7 @@ class Kernel {
    *
    * 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
@@ -200,7 +200,7 @@ class Kernel {
   }
 
   /**
-   * @param $apiRequest
+   * @param array $apiRequest
    * @throws \API_Exception
    */
   protected function validate($apiRequest) {
@@ -213,7 +213,8 @@ class Kernel {
    *   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 */
@@ -249,7 +250,8 @@ class Kernel {
    *   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 */
@@ -267,6 +269,7 @@ class Kernel {
    * @param array $result
    *   The response to return to the client.
    * @return mixed
+   *   The revised $result.
    */
   public function respond($apiProvider, $apiRequest, $result) {
     /** @var RespondEvent $event */
@@ -407,7 +410,7 @@ class Kernel {
       }
     }
 
-    $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'];