Civi/API - Fix various PHPStorm warnings
authorTim Otten <totten@civicrm.org>
Tue, 10 Jan 2017 00:44:59 +0000 (16:44 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 10 Jan 2017 01:02:27 +0000 (17:02 -0800)
Civi/API/Api3SelectQuery.php
Civi/API/Event/PrepareEvent.php
Civi/API/Kernel.php
Civi/API/Provider/AdhocProvider.php
Civi/API/SelectQuery.php
Civi/API/Subscriber/DynamicFKAuthorization.php
Civi/API/Subscriber/WhitelistSubscriber.php

index c4d758401b187f0f686f998515c5ff1870c51fdf..984b1746688ee0436c100dd2aa5117afa55fe5b0 100644 (file)
@@ -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) {
index bec3dfc375eb9db7519a965c1bcdb7785930bb97..c0a59c88e253369a448123e92b7bc47e775a0841 100644 (file)
@@ -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;
index e9040cc812df2cda067f45f5d0f189aff35057f9..3571201d80cee785473814d57b761e404f1c35c9 100644 (file)
@@ -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
    */
index 0327d20d320522ea6501e4ce5e9fb7fd0754b6e7..55c4df3b2b3bc5a64c940d05ec8fd5a50f155fba 100644 (file)
@@ -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(
index 497941e288e9751137c6c09406ad823b8587a680..06ad6c73f43570bfefed8c1a5abd8cb0cffe904f 100644 (file)
@@ -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
index 671ab21b097280f6bcba9f7bb65f7977ebcd1b14..ec6c8c01f5bbc254ca24395fe972ea6258bd92c4 100644 (file)
@@ -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
    */
index a117b530308ca550099b2d8c5b79e2d0beaead63..a32117b3e1d3c392515e99a73222a431b58cc88e 100644 (file)
@@ -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();