X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FCxnApp.php;h=f087d53e04043a2a11b36676ad87cbecba4d4a9d;hb=5ec753e358cd1692934daa7f5bd99384097fdf8c;hp=d3f6585f43679d5bf707390e2e2e6ce304ec0c7f;hpb=3bbe587eca52e262562cd1b06484eefa30480a08;p=civicrm-core.git diff --git a/api/v3/CxnApp.php b/api/v3/CxnApp.php index d3f6585f43..f087d53e04 100644 --- a/api/v3/CxnApp.php +++ b/api/v3/CxnApp.php @@ -1,32 +1,16 @@ 'appCert', 'type' => CRM_Utils_Type::T_TEXT, 'title' => ts('Certificate'), 'description' => 'PEM-encoded certificate', - ); - $spec['appId'] = array( + ]; + $spec['appId'] = [ 'name' => 'appId', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Application GUID'), 'description' => 'Application GUID', 'maxlength' => 128, 'size' => CRM_Utils_Type::HUGE, - ); - $spec['appUrl'] = array( + ]; + $spec['appUrl'] = [ 'name' => 'appUrl', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Registration URL'), 'description' => 'An endpoint to notify when performing registration', 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, - ); - $spec['desc'] = array( + ]; + $spec['desc'] = [ 'name' => 'desc', 'type' => CRM_Utils_Type::T_TEXT, 'title' => ts('Description'), 'description' => 'Description', - ); + ]; //$spec['perm'] = array( // 'name' => 'perm', // 'type' => CRM_Utils_Type::T_TEXT, @@ -104,16 +88,16 @@ function civicrm_api3_cxn_app_get($params) { $agent = new \Civi\Cxn\Rpc\Agent(NULL, NULL); $agent->setCertValidator(CRM_Cxn_BAO_Cxn::createCertificateValidator()); - $message = $agent->decode(array(AppMetasMessage::NAME, GarbledMessage::NAME), $blob); + $message = $agent->decode([AppMetasMessage::NAME, GarbledMessage::NAME], $blob); if ($message instanceof AppMetasMessage) { return _civicrm_api3_basic_array_get('CxnApp', $params, $message->getData(), 'appId', - array('appId', 'appUrl', 'desc', 'appCert', 'perm')); + ['appId', 'appUrl', 'desc', 'appCert', 'perm']); } elseif ($message instanceof GarbledMessage) { - return civicrm_api3_create_error('Received garbled response', array( + return civicrm_api3_create_error('Received garbled response', [ 'garbled_message' => $message->getData(), - )); + ]); } else { return civicrm_api3_create_error("Unrecognized message");