* @package Civi\API\Subscriber
*/
class TransactionSubscriber implements EventSubscriberInterface {
+
/**
* @return array
*/
public static function getSubscribedEvents() {
- return array(
- Events::PREPARE => array('onApiPrepare', Events::W_EARLY),
- Events::RESPOND => array('onApiRespond', Events::W_MIDDLE),
- Events::EXCEPTION => array('onApiException', Events::W_EARLY),
- );
+ return [
+ Events::PREPARE => ['onApiPrepare', Events::W_EARLY],
+ Events::RESPOND => ['onApiRespond', Events::W_MIDDLE],
+ Events::EXCEPTION => ['onApiException', Events::W_EARLY],
+ ];
}
/**
* @var array (scalar $apiRequestId => CRM_Core_Transaction $tx)
*/
- private $transactions = array();
+ private $transactions = [];
/**
* @var array (scalar $apiRequestId => bool)
* A list of requests which should be forcibly rolled back to
* their save points.
*/
- private $forceRollback = array();
+ private $forceRollback = [];
/**
* Determine if an API request should be treated as transactional.