Crummy\Phlack\Bot\AbstractBot::__construct PHP Method

__construct() public method

public __construct ( Crummy\Phlack\Common\Matcher\MatcherInterface $matcher = null, array | Crummy\Phlack\Common\Responder\ResponderInterface $options = [] )
$matcher Crummy\Phlack\Common\Matcher\MatcherInterface
$options array | Crummy\Phlack\Common\Responder\ResponderInterface
    public function __construct($matcher = null, $options = [])
    {
        if (!$matcher) {
            $matcher = new Matcher\DefaultMatcher();
        }
        $this->setMatcher($matcher);
        $this->responder = $options instanceof ResponderInterface ? $options : new Iterocitor($options);
    }

Usage Example

Example #1
0
 /**
  * @param string             $commandName
  * @param ExpressionLanguage $language
  */
 public function __construct($commandName = '/expr', ExpressionLanguage $language = null)
 {
     $this->language = $language ?: new ExpressionLanguage();
     parent::__construct(new CommandMatcher($commandName));
 }