CRM-15988 - Cleanup internal use of entity names
[civicrm-core.git] / Civi / API / Provider / ReflectionProvider.php
index c6cecdec3d6e3eb944d10131c742aabf403c9cf8..bd56c65ddd7c97d43836901fcfb9b61ee7b23c5b 100644 (file)
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 namespace Civi\API\Provider;
 
@@ -67,10 +67,7 @@ class ReflectionProvider implements EventSubscriberInterface, ProviderInterface
   public function __construct($apiKernel) {
     $this->apiKernel = $apiKernel;
     $this->actions = array(
-      // FIXME: We really need to deal with the api's lack of uniformity wrt
-      // case (Entity or entity).
       'Entity' => array('get', 'getactions'),
-      'entity' => array('get', 'getactions'),
       '*' => array('getactions'), // 'getfields'
     );
   }
@@ -108,6 +105,9 @@ class ReflectionProvider implements EventSubscriberInterface, ProviderInterface
 
   /**
    * {inheritdoc}
+   * @param array $apiRequest
+   * @return array
+   * @throws \API_Exception
    */
   public function invoke($apiRequest) {
     if (strtolower($apiRequest['entity']) == 'entity' && $apiRequest['action'] == 'get') {
@@ -129,6 +129,8 @@ class ReflectionProvider implements EventSubscriberInterface, ProviderInterface
 
   /**
    * {inheritdoc}
+   * @param int $version
+   * @return array
    */
   public function getEntityNames($version) {
     return array('Entity');
@@ -136,9 +138,13 @@ class ReflectionProvider implements EventSubscriberInterface, ProviderInterface
 
   /**
    * {inheritdoc}
+   * @param int $version
+   * @param string $entity
+   * @return array
    */
   public function getActionNames($version, $entity) {
     $entity = _civicrm_api_get_camel_name($entity, $version);
     return isset($this->actions[$entity]) ? $this->actions[$entity] : $this->actions['*'];
   }
+
 }