Merge pull request #13906 from agh1/whygroupcontribamt
[civicrm-core.git] / api / v3 / EntityTag.php
index 6b0bd7033e1db81c51ddbaae92c5e99429dcb938..6ed334f78124d9bfb1be27316c4151ed2d8a7fe6 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2017                                |
+ | Copyright CiviCRM LLC (c) 2004-2019                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -54,7 +54,7 @@ function civicrm_api3_entity_tag_get($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_entity_tag_get_spec(&$params) {
-  $params['entity_id']['api.aliases'] = array('contact_id');
+  $params['entity_id']['api.aliases'] = ['contact_id'];
   $params['entity_table']['api.default'] = 'civicrm_contact';
 }
 
@@ -101,7 +101,7 @@ function _civicrm_api3_entity_tag_delete_spec(&$params) {
  */
 function _civicrm_api3_entity_tag_common($params, $op = 'add') {
 
-  $entityIDs = $tagIDs = array();
+  $entityIDs = $tagIDs = [];
   $entityTable = 'civicrm_contact';
   if (is_array($params)) {
     foreach ($params as $n => $v) {
@@ -135,7 +135,7 @@ function _civicrm_api3_entity_tag_common($params, $op = 'add') {
     }
   }
 
-  $values = array('is_error' => 0);
+  $values = ['is_error' => 0];
   if ($op == 'add') {
     $values['total_count'] = $values['added'] = $values['not_added'] = 0;
     foreach ($tagIDs as $tagID) {
@@ -168,7 +168,6 @@ function _civicrm_api3_entity_tag_common($params, $op = 'add') {
 function civicrm_api3_entity_tag_replace($params) {
   $transaction = new CRM_Core_Transaction();
   try {
-    civicrm_api3_verify_one_mandatory($params, NULL, ['values', 'tag_id']);
 
     $baseParams = _civicrm_api3_generic_replace_base_params($params);
     unset($baseParams['tag_id']);