From 066c4638ed278b156dd6e8e7a7794af6fb9ef1ff Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 9 Jan 2017 16:44:59 -0800 Subject: [PATCH] Civi/API - Fix various PHPStorm warnings --- Civi/API/Api3SelectQuery.php | 4 ++++ Civi/API/Event/PrepareEvent.php | 2 +- Civi/API/Kernel.php | 8 ++++++++ Civi/API/Provider/AdhocProvider.php | 2 +- Civi/API/SelectQuery.php | 2 +- Civi/API/Subscriber/DynamicFKAuthorization.php | 1 + Civi/API/Subscriber/WhitelistSubscriber.php | 1 + 7 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Civi/API/Api3SelectQuery.php b/Civi/API/Api3SelectQuery.php index c4d758401b..984b174668 100644 --- a/Civi/API/Api3SelectQuery.php +++ b/Civi/API/Api3SelectQuery.php @@ -141,6 +141,10 @@ class Api3SelectQuery extends SelectQuery { * Fetch a field from the getFields list * * Searches by name, uniqueName, and api.aliases + * + * @param string $fieldName + * Field name. + * @return NULL|mixed */ protected function getField($fieldName) { if (!$fieldName) { diff --git a/Civi/API/Event/PrepareEvent.php b/Civi/API/Event/PrepareEvent.php index bec3dfc375..c0a59c88e2 100644 --- a/Civi/API/Event/PrepareEvent.php +++ b/Civi/API/Event/PrepareEvent.php @@ -35,7 +35,7 @@ class PrepareEvent extends Event { /** * @param array $apiRequest * The full description of the API request. - * @return RespondEvent + * @return PrepareEvent */ public function setApiRequest($apiRequest) { $this->apiRequest = $apiRequest; diff --git a/Civi/API/Kernel.php b/Civi/API/Kernel.php index e9040cc812..3571201d80 100644 --- a/Civi/API/Kernel.php +++ b/Civi/API/Kernel.php @@ -62,6 +62,14 @@ class Kernel { /** * @deprecated + * @param string $entity + * Type of entities to deal with. + * @param string $action + * Create, get, delete or some special action name. + * @param array $params + * Array to be passed to API function. + * @param mixed $extra + * Unused/deprecated. * @return array|int * @see runSafe */ diff --git a/Civi/API/Provider/AdhocProvider.php b/Civi/API/Provider/AdhocProvider.php index 0327d20d32..55c4df3b2b 100644 --- a/Civi/API/Provider/AdhocProvider.php +++ b/Civi/API/Provider/AdhocProvider.php @@ -87,7 +87,7 @@ class AdhocProvider implements EventSubscriberInterface, ProviderInterface { * Permissions required for invoking the action. * @param mixed $callback * The function which executes the API. - * @return ReflectionProvider + * @return AdhocProvider */ public function addAction($name, $perm, $callback) { $this->actions[strtolower($name)] = array( diff --git a/Civi/API/SelectQuery.php b/Civi/API/SelectQuery.php index 497941e288..06ad6c73f4 100644 --- a/Civi/API/SelectQuery.php +++ b/Civi/API/SelectQuery.php @@ -114,7 +114,7 @@ abstract class SelectQuery { /** * Build & execute the query and return results array * - * @return array + * @return array|int * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Exception diff --git a/Civi/API/Subscriber/DynamicFKAuthorization.php b/Civi/API/Subscriber/DynamicFKAuthorization.php index 671ab21b09..ec6c8c01f5 100644 --- a/Civi/API/Subscriber/DynamicFKAuthorization.php +++ b/Civi/API/Subscriber/DynamicFKAuthorization.php @@ -201,6 +201,7 @@ class DynamicFKAuthorization implements EventSubscriberInterface { * The target entity ID. * @param array $apiRequest * The full API request. + * @throws \Exception * @throws \API_Exception * @throws \Civi\API\Exception\UnauthorizedException */ diff --git a/Civi/API/Subscriber/WhitelistSubscriber.php b/Civi/API/Subscriber/WhitelistSubscriber.php index a117b53030..a32117b3e1 100644 --- a/Civi/API/Subscriber/WhitelistSubscriber.php +++ b/Civi/API/Subscriber/WhitelistSubscriber.php @@ -70,6 +70,7 @@ class WhitelistSubscriber implements EventSubscriberInterface { * @param array $rules * Array of WhitelistRule. * @see WhitelistRule + * @throws \CRM_Core_Exception */ public function __construct($rules) { $this->rules = array(); -- 2.25.1