X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FFile.php;h=cfa56b8f70bfd45576201a9e7bc30453e8c9ca0b;hb=46d87393f7bd29c1a5416e62207293f58115412c;hp=583d41e582bc2f058df13fb67a2594a078347120;hpb=2b65ef52f825cf17f345ecc3279fa235e4184ec9;p=civicrm-core.git diff --git a/api/v3/File.php b/api/v3/File.php index 583d41e582..cfa56b8f70 100644 --- a/api/v3/File.php +++ b/api/v3/File.php @@ -47,14 +47,14 @@ */ function civicrm_api3_file_create($params) { - civicrm_api3_verify_mandatory($params, 'CRM_Core_DAO_File', array('uri')); + civicrm_api3_verify_mandatory($params, 'CRM_Core_DAO_File', ['uri']); if (!isset($params['upload_date'])) { $params['upload_date'] = date("Ymd"); } $fileDAO = new CRM_Core_DAO_File(); - $properties = array( + $properties = [ 'id', 'file_type_id', 'mime_type', @@ -62,7 +62,7 @@ function civicrm_api3_file_create($params) { 'document', 'description', 'upload_date', - ); + ]; foreach ($properties as $name) { if (array_key_exists($name, $params)) { @@ -72,7 +72,7 @@ function civicrm_api3_file_create($params) { $fileDAO->save(); - $file = array(); + $file = []; _civicrm_api3_object_to_array($fileDAO, $file); return civicrm_api3_create_success($file, $params, 'File', 'create', $fileDAO); @@ -114,7 +114,7 @@ function civicrm_api3_file_update($params) { } $fileDAO->save(); } - $file = array(); + $file = []; $cloneDAO = clone($fileDAO); _civicrm_api3_object_to_array($cloneDAO, $file); return $file; @@ -130,7 +130,7 @@ function civicrm_api3_file_update($params) { */ function civicrm_api3_file_delete($params) { - civicrm_api3_verify_mandatory($params, NULL, array('id')); + civicrm_api3_verify_mandatory($params, NULL, ['id']); if (CRM_Core_BAO_File::deleteEntityFile('*', $params['id'])) { return civicrm_api3_create_success(); }