From 8ecf6ad3cbd4bdff951dd5fbf22a3716746f660c Mon Sep 17 00:00:00 2001 From: Dominic Tubach Date: Mon, 26 Feb 2024 17:15:09 +0100 Subject: [PATCH] Api4Interface: Make `$options` optional in `countEntities()` --- Civi/RemoteTools/Api4/Api4.php | 2 +- Civi/RemoteTools/Api4/Api4Interface.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Civi/RemoteTools/Api4/Api4.php b/Civi/RemoteTools/Api4/Api4.php index c86a0a8..bfcda42 100644 --- a/Civi/RemoteTools/Api4/Api4.php +++ b/Civi/RemoteTools/Api4/Api4.php @@ -40,7 +40,7 @@ public function __construct() { self::$instance = $this; } - public function countEntities(string $entityName, ConditionInterface $where, array $options): int { + public function countEntities(string $entityName, ConditionInterface $where, array $options = []): int { return $this->execute($entityName, 'get', [ 'checkPermissions' => $options['checkPermissions'] ?? FALSE, 'select' => ['row_count'], diff --git a/Civi/RemoteTools/Api4/Api4Interface.php b/Civi/RemoteTools/Api4/Api4Interface.php index e97adba..024b186 100644 --- a/Civi/RemoteTools/Api4/Api4Interface.php +++ b/Civi/RemoteTools/Api4/Api4Interface.php @@ -38,7 +38,7 @@ interface Api4Interface { * * @throws \CRM_Core_Exception */ - public function countEntities(string $entityName, ConditionInterface $where, array $options): int; + public function countEntities(string $entityName, ConditionInterface $where, array $options = []): int; /** * @param array $params