Skip to content

Commit

Permalink
Minor tidy ups
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Jan 30, 2023
1 parent 49804ee commit 2e6c66d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
13 changes: 6 additions & 7 deletions Civixero.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function civixero_is_extension_installed(string $extension): bool {
*
* @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterSettingsMetaData/
*/
function civixero_civicrm_alterSettingsMetaData(array &$settingsMetaData, int $domainID, $profile): void {
function civixero_civicrm_alterSettingsMetaData(array &$settingsMetaData): void {
$weight = 100;
foreach ($settingsMetaData as $index => $setting) {
if (($setting['group'] ?? '') === 'accountsync') {
Expand All @@ -72,14 +72,14 @@ function civixero_civicrm_alterSettingsMetaData(array &$settingsMetaData, int $d
/**
* Get contributions for a single contact.
*
* @param int $contactid
* @param int $contactID
*
* @return array
* @throws \CiviCRM_API3_Exception
*/
function getContactContributions(int $contactid): array {
function getContactContributions(int $contactID): array {
$contributions = civicrm_api3('Contribution', 'get', [
'contact_id' => $contactid,
'contact_id' => $contactID,
'return' => ['contribution_id'],
'sequential' => TRUE,
])['values'];
Expand All @@ -95,7 +95,7 @@ function getContactContributions(int $contactid): array {
*
* @throws \CiviCRM_API3_Exception
*/
function getErroredInvoicesOfContributions($contributions) {
function getErroredInvoicesOfContributions(array $contributions): array {
return civicrm_api3('AccountInvoice', 'get', [
'plugin' => 'xero',
'sequential' => TRUE,
Expand Down Expand Up @@ -231,8 +231,7 @@ function _civixero_get_connectors(): array {
$connectors = civicrm_api3('connector', 'get', ['connector_type_id' => 'CiviXero']);
$connectors = $connectors['values'];
}
/** @noinspection PhpUnusedLocalVariableInspection */
catch (CiviCRM_API3_Exception $e) {
catch (CRM_Core_Exception $e) {
$connectors = [0 => 0];
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/Xero/Xero.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ public function __call($name, $arguments) {
try {
if (@simplexml_load_string($temp_xero_response) == FALSE) {
throw new XeroException($temp_xero_response);
$xero_xml = FALSE;
}
else {
$xero_xml = simplexml_load_string($temp_xero_response);
Expand Down

0 comments on commit 2e6c66d

Please sign in to comment.