public function validateEventExist($event, $events)
    {
        if ($event == '') {
            return null;
        }

        if (!in_array($event, array_values($events))) {
            throw new \InvalidArgumentException(sprintf('Event "%s" is invalid.', $event));
        }

        return $event;
    }
public function validateEventExist($event, $events)
    {
        if ($event == '') {
            return null;
        }

        if (!in_array($event, array_values($events))) {
            throw new \InvalidArgumentException(sprintf('Event "%s" is invalid.', $event));
        }

        return $event;
    }
public function validateEventExist ( $ event , $ events ) { if ( $ event == '' ) { return null ; } if ( ! in_array ( $ event , array_values ( $ events ) ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Event "%s" is invalid.' , $ event ) ) ; } return $ event ; }
Validate if event name exist.

@param string $event  Event name
@param array  $events Array of events

@return string
Validate if event name exist .