public function testConstructor()
 {
     $event = new BoltFormsCustomDataEvent('koala', array('leaves'));
     $event->setData('gum-leaves');
     $this->assertSame('koala', $event->getName());
     $this->assertSame(array('leaves'), $event->getParameters());
     $this->assertSame('gum-leaves', $event->getData());
 }
 /**
  * Fetch the current (formatted) timestamp.
  *
  * @param BoltFormsCustomDataEvent $event
  */
 public function timestamp(BoltFormsCustomDataEvent $event)
 {
     $params = $event->getParameters();
     if (!isset($params['format'])) {
         return;
     }
     $event->setData(strftime($params['format']));
 }
 /**
  * Fetch a value from the session data.
  *
  * @param BoltFormsCustomDataEvent $event
  */
 public function sessionValue(BoltFormsCustomDataEvent $event)
 {
     $params = $event->eventParams();
     if (!isset($params['key'])) {
         return;
     }
     $event->setData($this->app['session']->get($params['key']));
 }