checkCallable() public static method

public static checkCallable ( callable $callable, string $type, string $info, Context $context = null ) : boolean
$callable callable
$type string a type description of the callable eg: State::CALLABLE_ENTRY
$info string extra info for exception message purposes
$context izzum\statemachine\Context optional: the context the callable is called in
return boolean
 /**
  * calls the $callable as part of the transition
  * @param callable $callable
  * @param Context $context
  * @throws Exception in case of an invalid callable
  */
 protected function callCallable($callable, Context $context, $type = 'n/a')
 {
     //in case it is a guard callable we need to return true/false
     if ($callable != self::CALLABLE_NULL) {
         Utils::checkCallable($callable, $type, "transition: " . $this, $context);
         return (bool) call_user_func($callable, $context->getEntity());
     }
     return true;
 }
 /**
  * calls a $callable if it exists, with the arguments $context->getEntity()
  * @param callable $callable
  * @param Context $context
  * @param string $type the type of callable (self::CALLABLE_ENTRY | self::CALLABLE_EXIT)
  */
 protected function callCallable($callable, Context $context, $type = 'n/a')
 {
     if ($callable != self::CALLABLE_NULL) {
         Utils::checkCallable($callable, $type, $this, $context);
         call_user_func($callable, $context->getEntity());
     }
 }