Merge pull request #6206 from mlutfy/4.6-crm16839
[civicrm-core.git] / Civi / API / Provider / ReflectionProvider.php
index c6cecdec3d6e3eb944d10131c742aabf403c9cf8..188e4f2d6d4662b87008bdce6fa5922de01789f6 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -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['*'];
   }
+
 }