Example #1
0
 /**
  * @param string $matcher
  *
  * @return $this
  */
 public static function matching($matcher)
 {
     if (is_string($matcher) != true) {
         throw new \InvalidArgumentException('A console action should have a URI pattern as matching term; received: ' . var_export($matcher, true));
     }
     return parent::matching(new Command($matcher));
 }
Example #2
0
 /**
  * @param \Somos\Action $action
  * @return bool
  */
 private function isConsoleCommand(\Somos\Action $action)
 {
     return $action->getMatcher() instanceof Command;
 }
Example #3
0
 /**
  * Returns an example action object that can be used to populate the MessageBus with; no command is able to handle
  * this.
  *
  * @return Action
  */
 private function givenAnExampleAction()
 {
     return Action::matches('/');
 }