PHP Class Crummy\Phlack\Bot\Mainframe\Mainframe

Inheritance: implements Crummy\Phlack\Common\Executable
Mostrar archivo Open project: mcrumm/phlack Class Usage Examples

Public Methods

Method Description
__construct ( ) Constructor.
attach ( Crummy\Phlack\Bot\BotInterface $bot, Crummy\Phlack\Common\Matcher\MatcherInterface | callable $matcher = null, integer $priority ) : self
execute ( Crummy\Phlack\WebHook\CommandInterface $command ) : Packet
getListener ( Crummy\Phlack\Bot\BotInterface $bot, Crummy\Phlack\Common\Matcher\MatcherInterface | callable $matcher ) : Closure

Method Details

__construct() public method

Constructor.
public __construct ( )

attach() public method

public attach ( Crummy\Phlack\Bot\BotInterface $bot, Crummy\Phlack\Common\Matcher\MatcherInterface | callable $matcher = null, integer $priority ) : self
$bot Crummy\Phlack\Bot\BotInterface
$matcher Crummy\Phlack\Common\Matcher\MatcherInterface | callable If callable, it should accept a CommandInterface and return a boolean.
$priority integer
return self

execute() public method

public execute ( Crummy\Phlack\WebHook\CommandInterface $command ) : Packet
$command Crummy\Phlack\WebHook\CommandInterface
return Packet

getListener() public method

public getListener ( Crummy\Phlack\Bot\BotInterface $bot, Crummy\Phlack\Common\Matcher\MatcherInterface | callable $matcher ) : Closure
$bot Crummy\Phlack\Bot\BotInterface
$matcher Crummy\Phlack\Common\Matcher\MatcherInterface | callable If callable, it should accept a CommandInterface and return a boolean.
return Closure An anonymous function to be attached to the internal cpu.