|
Erebot
latest
A modular IRC bot for PHP 5.3+
|
Interface for a class that can be used to parse incoming messages from an IRC server and create events as necessary. More...
Inheritance diagram for Erebot\Interfaces\IrcParser:Public Member Functions | |
| getEventClass ($iface) | |
| getEventClasses () | |
| makeEvent ($iface) | |
| parseLine ($msg) | |
| setEventClass ($iface, $cls) | |
| setEventClasses ($events) | |
Interface for a class that can be used to parse incoming messages from an IRC server and create events as necessary.
Definition at line 29 of file IrcParser.php.
| Erebot\Interfaces\IrcParser::getEventClass | ( | $iface | ) |
Returns the name of the class used to create events for a certain interface.
| string | $iface | The name of the interface describing the type of event. |
| string | Name of the class to use to create events for the given interface. |
| null | Returned when no class has been registered yet to create events for the given interface. |
Implemented in Erebot\IrcParser.
| Erebot\Interfaces\IrcParser::getEventClasses | ( | ) |
Returns the mapping of interface names to their factory.
| array | Mapping of event interfaces names to their factory. |
Implemented in Erebot\IrcParser.
| Erebot\Interfaces\IrcParser::makeEvent | ( | $iface | ) |
Factory to create an event matching the given interface, passing any additional parameters given to this method to the constructor for that event.
| string | $iface | Name of the interface describing the type of event to create. |
| Erebot::Interfaces::Event::Base_Generic | The event that was produced. This will be an instance implementing the given interface and a subclass of Erebot::Interfaces::Event::Base::Generic. |
Implemented in Erebot\IrcParser.
| Erebot\Interfaces\IrcParser::parseLine | ( | $msg | ) |
Parses a single message from an IRC server.
| string | $msg | A single IRC message to parse, with the trailing "\r\n" sequence already removed. |
Implemented in Erebot\IrcParser.
| Erebot\Interfaces\IrcParser::setEventClass | ( | $iface, | |
| $cls | |||
| ) |
Sets the class to use when creating events for a certain interface.
| string | $iface | Interface to associate the class with. |
| string | $cls | Class to use when creating events for that interface. |
| Erebot::InvalidValueException | The given class does not implement the given interface and therefore cannot be used as a factory. |
Implemented in Erebot\IrcParser.
| Erebot\Interfaces\IrcParser::setEventClasses | ( | $events | ) |
Sets the mapping from event interfaces names to their factory.
| array | $events | Mapping from interfaces names to their factory. |
Implemented in Erebot\IrcParser.