class Events

Supports operations related to Events/Listeners.

Constants

private EVENT_PATH

Path for event classes.

private LISTENER_PATH

Path for listener classes.

private PROVIDER_PATH

Path for provider classes.

Methods

static string
eventTemplate(string $eventName)

Template for new event.

static string
eventServiceProviderTemplate(string $providerName)

Template for event service provider.

static string
listenerTemplate(string $eventName, string $listenerName)

Template for event listener class.

static int
makeEvent(string $eventName, bool $queue = false)

Creates a new event class.

static int
makeEventServiceProvider(string $providerName)

Creates a new event service provider.

static int
makeListener(string $eventName, string $listenerName, bool $queue = false)

Creates a new listener class.

static string
queueEventTemplate(string $eventName)

Returns template for event class when queue flag is set.

static string
queueListenerTemplate(string $eventName, string $listenerName)

Generates a stub for queue listener class.

static bool
verifyListenerParams(string $eventName, string $listenerName)

Checks if $eventName and $listerName was provided and that they are not the same.

Details

at line 31
static string eventTemplate(string $eventName)

Template for new event.

Parameters

string $eventName

The name for the new event class.

Return Value

string

The content for the new event class.

at line 64
static string eventServiceProviderTemplate(string $providerName)

Template for event service provider.

Parameters

string $providerName

The name of the event service provider.

Return Value

string

The content of the event service provider.

at line 100
static string listenerTemplate(string $eventName, string $listenerName)

Template for event listener class.

Parameters

string $eventName

The name of the event.

string $listenerName

The name of the listener.

Return Value

string

The content for the new listener class.

at line 132
static int makeEvent(string $eventName, bool $queue = false)

Creates a new event class.

Parameters

string $eventName

The name for the event.

bool $queue

If true then function creates version of file for queues.

Return Value

int

A value that indicates success, invalid, or failure.

at line 149
static int makeEventServiceProvider(string $providerName)

Creates a new event service provider.

Parameters

string $providerName

The name for the event service provider.

Return Value

int

A value that indicates success, invalid, or failure.

at line 168
static int makeListener(string $eventName, string $listenerName, bool $queue = false)

Creates a new listener class.

Parameters

string $eventName

The name of the event.

string $listenerName

The name of the listener.

bool $queue

If true then function creates version of file for queues.

Return Value

int

A value that indicates success, invalid, or failure.

at line 186
static string queueEventTemplate(string $eventName)

Returns template for event class when queue flag is set.

Parameters

string $eventName

The name of the event.

Return Value

string

The contents of the event class.

at line 240
static string queueListenerTemplate(string $eventName, string $listenerName)

Generates a stub for queue listener class.

Parameters

string $eventName

The name of the event.

string $listenerName

The name of the listener.

Return Value

string

The stub for a queue listener class.

at line 311
static bool verifyListenerParams(string $eventName, string $listenerName)

Checks if $eventName and $listerName was provided and that they are not the same.

Parameters

string $eventName

The name of the event.

string $listenerName

The name of the listener.

Return Value

bool

If True then both params were provided and not the same. Otherwise, we return false.