From: Eileen McNaughton Date: Sat, 24 May 2014 03:22:47 +0000 (+1200) Subject: missing comments in civi dir X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6550386ac4c8591241445ee37d0e5b9697595a8e;p=civicrm-core.git missing comments in civi dir --- diff --git a/Civi/API/Event/AuthorizeEvent.php b/Civi/API/Event/AuthorizeEvent.php index 42b814db9a..dbe6cc17b9 100644 --- a/Civi/API/Event/AuthorizeEvent.php +++ b/Civi/API/Event/AuthorizeEvent.php @@ -27,6 +27,10 @@ namespace Civi\API\Event; +/** + * Class AuthorizeEvent + * @package Civi\API\Event + */ class AuthorizeEvent extends Event { /** * @var bool diff --git a/Civi/API/Event/Event.php b/Civi/API/Event/Event.php index 2c521673c2..0fab1eda3a 100644 --- a/Civi/API/Event/Event.php +++ b/Civi/API/Event/Event.php @@ -27,6 +27,10 @@ namespace Civi\API\Event; +/** + * Class Event + * @package Civi\API\Event + */ class Event extends \Symfony\Component\EventDispatcher\Event { /** * @var \Civi\API\Provider\ProviderInterface @@ -38,6 +42,10 @@ class Event extends \Symfony\Component\EventDispatcher\Event { */ protected $apiRequest; + /** + * @param $apiProvider + * @param $apiRequest + */ function __construct($apiProvider, $apiRequest) { $this->apiProvider = $apiProvider; $this->apiRequest = $apiRequest; diff --git a/Civi/API/Event/ExceptionEvent.php b/Civi/API/Event/ExceptionEvent.php index c7771eefbf..d80425ef86 100644 --- a/Civi/API/Event/ExceptionEvent.php +++ b/Civi/API/Event/ExceptionEvent.php @@ -27,6 +27,10 @@ namespace Civi\API\Event; +/** + * Class ExceptionEvent + * @package Civi\API\Event + */ class ExceptionEvent extends Event { /** @@ -34,6 +38,11 @@ class ExceptionEvent extends Event { */ private $exception; + /** + * @param $exception + * @param $apiProvider + * @param $apiRequest + */ function __construct($exception, $apiProvider, $apiRequest) { $this->exception = $exception; parent::__construct($apiProvider, $apiRequest); diff --git a/Civi/API/Event/PrepareEvent.php b/Civi/API/Event/PrepareEvent.php index f7cf7dceaa..5ee84f1f96 100644 --- a/Civi/API/Event/PrepareEvent.php +++ b/Civi/API/Event/PrepareEvent.php @@ -27,6 +27,10 @@ namespace Civi\API\Event; +/** + * Class PrepareEvent + * @package Civi\API\Event + */ class PrepareEvent extends Event { /** * @param array $apiRequest diff --git a/Civi/API/Event/ResolveEvent.php b/Civi/API/Event/ResolveEvent.php index 849ade2131..c62d40751a 100644 --- a/Civi/API/Event/ResolveEvent.php +++ b/Civi/API/Event/ResolveEvent.php @@ -27,7 +27,14 @@ namespace Civi\API\Event; +/** + * Class ResolveEvent + * @package Civi\API\Event + */ class ResolveEvent extends Event { + /** + * @param $apiRequest + */ function __construct($apiRequest) { parent::__construct(NULL, $apiRequest); } diff --git a/Civi/API/Event/RespondEvent.php b/Civi/API/Event/RespondEvent.php index e8fb548aa5..58a7aa7c35 100644 --- a/Civi/API/Event/RespondEvent.php +++ b/Civi/API/Event/RespondEvent.php @@ -27,12 +27,21 @@ namespace Civi\API\Event; +/** + * Class RespondEvent + * @package Civi\API\Event + */ class RespondEvent extends Event { /** * @var mixed */ private $response; + /** + * @param $apiProvider + * @param $apiRequest + * @param $response + */ function __construct($apiProvider, $apiRequest, $response) { $this->response = $response; parent::__construct($apiProvider, $apiRequest); diff --git a/Civi/API/Exception/NotImplementedException.php b/Civi/API/Exception/NotImplementedException.php index 69db92e02f..68ca54478a 100644 --- a/Civi/API/Exception/NotImplementedException.php +++ b/Civi/API/Exception/NotImplementedException.php @@ -2,8 +2,18 @@ namespace Civi\API\Exception; require_once 'api/Exception.php'; + +/** + * Class NotImplementedException + * @package Civi\API\Exception + */ class NotImplementedException extends \API_Exception { + /** + * @param string $message + * @param array $extraParams + * @param Exception $previous + */ public function __construct($message, $extraParams = array(), Exception $previous = NULL) { parent::__construct($message, \API_Exception::NOT_IMPLEMENTED, $extraParams, $previous); } -} \ No newline at end of file +} diff --git a/Civi/API/Exception/UnauthorizedException.php b/Civi/API/Exception/UnauthorizedException.php index 5595dcf7a1..7162a04f74 100644 --- a/Civi/API/Exception/UnauthorizedException.php +++ b/Civi/API/Exception/UnauthorizedException.php @@ -2,8 +2,18 @@ namespace Civi\API\Exception; require_once 'api/Exception.php'; + +/** + * Class UnauthorizedException + * @package Civi\API\Exception + */ class UnauthorizedException extends \API_Exception { + /** + * @param string $message + * @param array $extraParams + * @param Exception $previous + */ public function __construct($message, $extraParams = array(), Exception $previous = NULL) { parent::__construct($message, \API_Exception::UNAUTHORIZED, $extraParams, $previous); } -} \ No newline at end of file +} diff --git a/Civi/API/Kernel.php b/Civi/API/Kernel.php index c8dacea8fc..59f5e6c597 100644 --- a/Civi/API/Kernel.php +++ b/Civi/API/Kernel.php @@ -51,6 +51,10 @@ class Kernel { */ protected $apiProviders; + /** + * @param $dispatcher + * @param array $apiProviders + */ function __construct($dispatcher, $apiProviders = array()) { $this->apiProviders = $apiProviders; $this->dispatcher = $dispatcher; @@ -359,4 +363,4 @@ class Kernel { $this->dispatcher = $dispatcher; return $this; } -} \ No newline at end of file +} diff --git a/Civi/API/Provider/AdhocProvider.php b/Civi/API/Provider/AdhocProvider.php index 47e0cde494..e5a5d7a407 100644 --- a/Civi/API/Provider/AdhocProvider.php +++ b/Civi/API/Provider/AdhocProvider.php @@ -34,6 +34,9 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; */ class AdhocProvider implements EventSubscriberInterface, ProviderInterface { + /** + * @return array + */ public static function getSubscribedEvents() { return array( Events::RESOLVE => array( @@ -83,6 +86,9 @@ class AdhocProvider implements EventSubscriberInterface, ProviderInterface { return $this; } + /** + * @param \Civi\API\Event\ResolveEvent $event + */ public function onApiResolve(\Civi\API\Event\ResolveEvent $event) { $apiRequest = $event->getApiRequest(); if ($this->matchesRequest($apiRequest)) { @@ -92,6 +98,9 @@ class AdhocProvider implements EventSubscriberInterface, ProviderInterface { } } + /** + * @param \Civi\API\Event\AuthorizeEvent $event + */ public function onApiAuthorize(\Civi\API\Event\AuthorizeEvent $event) { $apiRequest = $event->getApiRequest(); if ($this->matchesRequest($apiRequest) && \CRM_Core_Permission::check($this->actions[strtolower($apiRequest['action'])]['perm'])) { @@ -126,7 +135,12 @@ class AdhocProvider implements EventSubscriberInterface, ProviderInterface { } } + /** + * @param $apiRequest + * + * @return bool + */ public function matchesRequest($apiRequest) { return $apiRequest['entity'] == $this->entity && $apiRequest['version'] == $this->version && isset($this->actions[strtolower($apiRequest['action'])]); } -} \ No newline at end of file +} diff --git a/Civi/API/Provider/MagicFunctionProvider.php b/Civi/API/Provider/MagicFunctionProvider.php index f3162041b5..83d250659d 100644 --- a/Civi/API/Provider/MagicFunctionProvider.php +++ b/Civi/API/Provider/MagicFunctionProvider.php @@ -34,6 +34,9 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; * conventions. */ class MagicFunctionProvider implements EventSubscriberInterface, ProviderInterface { + /** + * @return array + */ public static function getSubscribedEvents() { return array( Events::RESOLVE => array( @@ -47,10 +50,16 @@ class MagicFunctionProvider implements EventSubscriberInterface, ProviderInterfa */ private $cache; + /** + * + */ function __construct() { $this->cache = array(); } + /** + * @param \Civi\API\Event\ResolveEvent $event + */ public function onApiResolve(\Civi\API\Event\ResolveEvent $event) { $apiRequest = $event->getApiRequest(); $resolved = $this->resolve($apiRequest); diff --git a/Civi/API/Provider/ReflectionProvider.php b/Civi/API/Provider/ReflectionProvider.php index addaa3145d..676458faea 100644 --- a/Civi/API/Provider/ReflectionProvider.php +++ b/Civi/API/Provider/ReflectionProvider.php @@ -33,6 +33,9 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; * This class defines operations for inspecting the API's metadata. */ class ReflectionProvider implements EventSubscriberInterface, ProviderInterface { + /** + * @return array + */ public static function getSubscribedEvents() { return array( Events::RESOLVE => array( @@ -65,6 +68,9 @@ class ReflectionProvider implements EventSubscriberInterface, ProviderInterface ); } + /** + * @param \Civi\API\Event\ResolveEvent $event + */ public function onApiResolve(\Civi\API\Event\ResolveEvent $event) { $apiRequest = $event->getApiRequest(); $actions = isset($this->actions[$apiRequest['entity']]) ? $this->actions[$apiRequest['entity']] : $this->actions['*']; @@ -76,6 +82,9 @@ class ReflectionProvider implements EventSubscriberInterface, ProviderInterface } } + /** + * @param \Civi\API\Event\AuthorizeEvent $event + */ public function onApiAuthorize(\Civi\API\Event\AuthorizeEvent $event) { $apiRequest = $event->getApiRequest(); if (isset($apiRequest['is_metadata'])) { @@ -118,4 +127,4 @@ class ReflectionProvider implements EventSubscriberInterface, ProviderInterface function getActionNames($version, $entity) { return isset($this->actions[$entity]) ? $this->actions[$entity] : $this->actions['*']; } -} \ No newline at end of file +} diff --git a/Civi/API/Request.php b/Civi/API/Request.php index 3c6586c8b2..feded29855 100644 --- a/Civi/API/Request.php +++ b/Civi/API/Request.php @@ -26,6 +26,10 @@ */ namespace Civi\API; +/** + * Class Request + * @package Civi\API + */ class Request { private static $nextId = 1; diff --git a/Civi/API/Subscriber/APIv3SchemaAdapter.php b/Civi/API/Subscriber/APIv3SchemaAdapter.php index 54d5550737..904926e436 100644 --- a/Civi/API/Subscriber/APIv3SchemaAdapter.php +++ b/Civi/API/Subscriber/APIv3SchemaAdapter.php @@ -34,6 +34,9 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; * and validates that the fields are provided correctly. */ class APIv3SchemaAdapter implements EventSubscriberInterface { + /** + * @return array + */ public static function getSubscribedEvents() { return array( Events::PREPARE => array( @@ -43,6 +46,11 @@ class APIv3SchemaAdapter implements EventSubscriberInterface { ); } + /** + * @param \Civi\API\Event\PrepareEvent $event + * + * @throws \API_Exception + */ public function onApiPrepare(\Civi\API\Event\PrepareEvent $event) { $apiRequest = $event->getApiRequest(); if ($apiRequest['version'] > 3) { @@ -63,6 +71,11 @@ class APIv3SchemaAdapter implements EventSubscriberInterface { $event->setApiRequest($apiRequest); } + /** + * @param \Civi\API\Event\Event $event + * + * @throws \Exception + */ public function onApiPrepare_validate(\Civi\API\Event\Event $event) { $apiRequest = $event->getApiRequest(); // Not sure why this is omitted for generic actions. It would make sense to omit 'getfields', but that's only one generic action. @@ -100,4 +113,4 @@ class APIv3SchemaAdapter implements EventSubscriberInterface { } return $required; } -} \ No newline at end of file +} diff --git a/Civi/API/Subscriber/ChainSubscriber.php b/Civi/API/Subscriber/ChainSubscriber.php index 5c4549feff..c21192ae85 100644 --- a/Civi/API/Subscriber/ChainSubscriber.php +++ b/Civi/API/Subscriber/ChainSubscriber.php @@ -47,12 +47,20 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; * API call (and passes some extra context -- eg Amy's contact_id). */ class ChainSubscriber implements EventSubscriberInterface { + /** + * @return array + */ public static function getSubscribedEvents() { return array( Events::RESPOND => array('onApiRespond', Events::W_EARLY), ); } + /** + * @param \Civi\API\Event\RespondEvent $event + * + * @throws \Exception + */ public function onApiRespond(\Civi\API\Event\RespondEvent $event) { $apiRequest = $event->getApiRequest(); $result = $event->getResponse(); @@ -166,4 +174,4 @@ class ChainSubscriber implements EventSubscriberInterface { } } -} \ No newline at end of file +} diff --git a/Civi/API/Subscriber/I18nSubscriber.php b/Civi/API/Subscriber/I18nSubscriber.php index f920c44206..c5d36e6c24 100644 --- a/Civi/API/Subscriber/I18nSubscriber.php +++ b/Civi/API/Subscriber/I18nSubscriber.php @@ -29,13 +29,25 @@ namespace Civi\API\Subscriber; use Civi\API\Events; use Symfony\Component\EventDispatcher\EventSubscriberInterface; +/** + * Class I18nSubscriber + * @package Civi\API\Subscriber + */ class I18nSubscriber implements EventSubscriberInterface { + /** + * @return array + */ public static function getSubscribedEvents() { return array( Events::PREPARE => array('onApiPrepare', Events::W_MIDDLE) ); } + /** + * @param \Civi\API\Event\Event $event + * + * @throws \API_Exception + */ public function onApiPrepare(\Civi\API\Event\Event $event) { $apiRequest = $event->getApiRequest(); diff --git a/Civi/API/Subscriber/PermissionCheck.php b/Civi/API/Subscriber/PermissionCheck.php index 00bc3fef88..4ead4938f3 100644 --- a/Civi/API/Subscriber/PermissionCheck.php +++ b/Civi/API/Subscriber/PermissionCheck.php @@ -34,6 +34,9 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; * permissions specified in Civi\API\Annotation\Permission. */ class PermissionCheck implements EventSubscriberInterface { + /** + * @return array + */ public static function getSubscribedEvents() { return array( Events::AUTHORIZE => array( @@ -42,6 +45,11 @@ class PermissionCheck implements EventSubscriberInterface { ); } + /** + * @param \Civi\API\Event\AuthorizeEvent $event + * + * @throws \Civi\API\Exception\UnauthorizedException + */ public function onApiAuthorize(\Civi\API\Event\AuthorizeEvent $event) { $apiRequest = $event->getApiRequest(); if ($apiRequest['version'] < 4) { @@ -74,4 +82,4 @@ class PermissionCheck implements EventSubscriberInterface { $event->stopPropagation(); } } -} \ No newline at end of file +} diff --git a/Civi/API/Subscriber/TransactionSubscriber.php b/Civi/API/Subscriber/TransactionSubscriber.php index 71c8439736..9393f1dbc2 100644 --- a/Civi/API/Subscriber/TransactionSubscriber.php +++ b/Civi/API/Subscriber/TransactionSubscriber.php @@ -29,7 +29,14 @@ namespace Civi\API\Subscriber; use Civi\API\Events; use Symfony\Component\EventDispatcher\EventSubscriberInterface; +/** + * Class TransactionSubscriber + * @package Civi\API\Subscriber + */ class TransactionSubscriber implements EventSubscriberInterface { + /** + * @return array + */ public static function getSubscribedEvents() { return array( Events::PREPARE => array('onApiPrepare', Events::W_EARLY), @@ -86,4 +93,4 @@ class TransactionSubscriber implements EventSubscriberInterface { unset($this->transactions[$apiRequest['id']]); } } -} \ No newline at end of file +} diff --git a/Civi/API/Subscriber/WrapperAdapter.php b/Civi/API/Subscriber/WrapperAdapter.php index 9ea309dee0..48ba665e72 100644 --- a/Civi/API/Subscriber/WrapperAdapter.php +++ b/Civi/API/Subscriber/WrapperAdapter.php @@ -36,6 +36,9 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; */ class WrapperAdapter implements EventSubscriberInterface { + /** + * @return array + */ public static function getSubscribedEvents() { return array( Events::PREPARE => array('onApiPrepare', Events::W_MIDDLE), @@ -48,10 +51,16 @@ class WrapperAdapter implements EventSubscriberInterface { */ protected $defaults; + /** + * @param array $defaults + */ function __construct($defaults = array()) { $this->defaults = $defaults; } + /** + * @param \Civi\API\Event\PrepareEvent $event + */ public function onApiPrepare(\Civi\API\Event\PrepareEvent $event) { $apiRequest = $event->getApiRequest(); @@ -63,6 +72,9 @@ class WrapperAdapter implements EventSubscriberInterface { $event->setApiRequest($apiRequest); } + /** + * @param \Civi\API\Event\RespondEvent $event + */ public function onApiRespond(\Civi\API\Event\RespondEvent $event) { $apiRequest = $event->getApiRequest(); $result = $event->getResponse(); @@ -86,4 +98,4 @@ class WrapperAdapter implements EventSubscriberInterface { } return $apiRequest['wrappers']; } -} \ No newline at end of file +} diff --git a/Civi/API/Subscriber/XDebugSubscriber.php b/Civi/API/Subscriber/XDebugSubscriber.php index af23ecf41d..46b03c9c5e 100644 --- a/Civi/API/Subscriber/XDebugSubscriber.php +++ b/Civi/API/Subscriber/XDebugSubscriber.php @@ -29,13 +29,23 @@ namespace Civi\API\Subscriber; use Civi\API\Events; use Symfony\Component\EventDispatcher\EventSubscriberInterface; +/** + * Class XDebugSubscriber + * @package Civi\API\Subscriber + */ class XDebugSubscriber implements EventSubscriberInterface { + /** + * @return array + */ public static function getSubscribedEvents() { return array( Events::RESPOND => array('onApiRespond', Events::W_LATE), ); } + /** + * @param \Civi\API\Event\RespondEvent $event + */ function onApiRespond(\Civi\API\Event\RespondEvent $event) { $apiRequest = $event->getApiRequest(); $result = $event->getResponse(); @@ -50,4 +60,4 @@ class XDebugSubscriber implements EventSubscriberInterface { $event->setResponse($result); } } -} \ No newline at end of file +} diff --git a/Civi/Core/Container.php b/Civi/Core/Container.php index eb0b13f11d..504f206666 100644 --- a/Civi/Core/Container.php +++ b/Civi/Core/Container.php @@ -13,6 +13,10 @@ use Symfony\Component\DependencyInjection\Reference; // TODO use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; +/** + * Class Container + * @package Civi\Core + */ class Container { const SELF = 'civi_container_factory';