Erebot  latest
A modular IRC bot for PHP 7.0+
Erebot\Event\Match\Type Class Reference

A filter that matches based on the type of event provided. More...

+ Inheritance diagram for Erebot\Event\Match\Type:

Public Member Functions

 __construct ($type)
 
 getType ()
 
 match (\Erebot\Interfaces\Event\Base\Generic $event)
 
 setType ($types)
 

Protected Attributes

 $type
 Type to use in comparisons, as a string.
 

Detailed Description

A filter that matches based on the type of event provided.

Definition at line 27 of file Type.php.

Constructor & Destructor Documentation

Erebot\Event\Match\Type::__construct (   $type)

Creates a new instance of this filter.

Parameters
string | object$typeType to match incoming events against.

Definition at line 38 of file Type.php.

References Erebot\Event\Match\Type\$type, and Erebot\Event\Match\Type\setType().

Member Function Documentation

Erebot\Event\Match\Type::getType ( )

Returns the type associated with this filter.

Return values
arrayArray of types (as strings) associated with this filter.

Definition at line 49 of file Type.php.

References Erebot\Event\Match\Type\$type.

Erebot\Event\Match\Type::setType (   $types)

Sets the type used in comparisons.

Parameters
$typesstring|object|array Type(s) to match incoming events against, either as a string or as an instance of the type of match against. An array of strings/objects may also be passed; The filter will match if the incoming event is of any of the types given.
Exceptions
Erebot::InvalidValueExceptionThe given type is invalid.

Definition at line 68 of file Type.php.

References Erebot\Event\Match\Type\$type.

Referenced by Erebot\Event\Match\Type\__construct().


The documentation for this class was generated from the following file: