From bee89fec5adb2629ead5d5dec6187469b66d48ba Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 4 May 2022 06:57:37 +1200 Subject: [PATCH] IDE cheer - cast var explicitly to an int --- CRM/Contact/BAO/Contact/Utils.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Contact/BAO/Contact/Utils.php b/CRM/Contact/BAO/Contact/Utils.php index 0e8610d065..e680aedb24 100644 --- a/CRM/Contact/BAO/Contact/Utils.php +++ b/CRM/Contact/BAO/Contact/Utils.php @@ -249,7 +249,7 @@ WHERE id IN ( $idString ) * @throws \CRM_Core_Exception * @throws \CiviCRM_API3_Exception */ - public static function createCurrentEmployerRelationship($contactID, $employerID, $previousEmployerID = NULL, $newContact = FALSE) { + public static function createCurrentEmployerRelationship($contactID, $employerID, $previousEmployerID = NULL, $newContact = FALSE): void { if (!$employerID) { // This function is not called in core with no organization & should not be // Refs CRM-15368,CRM-15547 @@ -258,11 +258,11 @@ WHERE id IN ( $idString ) } if (!is_numeric($employerID)) { $dupeIDs = CRM_Contact_BAO_Contact::getDuplicateContacts(['organization_name' => $employerID], 'Organization', 'Unsupervised', [], FALSE); - $employerID = reset($dupeIDs) ?: Contact::create(FALSE) + $employerID = (int) (reset($dupeIDs) ?: Contact::create(FALSE) ->setValues([ 'contact_type' => 'Organization', 'organization_name' => $employerID, - ])->execute()->first()['id']; + ])->execute()->first()['id']); } $relationshipTypeID = CRM_Contact_BAO_RelationshipType::getEmployeeRelationshipTypeID(); -- 2.25.1