public function flow(string $event, ...$flow)
    {
        //listen for the main on global
        $this->on($event, function (...$args) use (&$flow) {
            $this->triggerFlow($flow, ...$args);

            //analyze the meta
            $meta = $this->getEventHandler()->getMeta();

            //if status is incomplete
            if ($meta === EventHandler::STATUS_INCOMPLETE) {
                //we should also stop the flow
                return false;
            }
        });

        return $this;
    }
public function flow(string $event, ...$flow)
    {
        //listen for the main on global
        $this->on($event, function (...$args) use (&$flow) {
            $this->triggerFlow($flow, ...$args);

            //analyze the meta
            $meta = $this->getEventHandler()->getMeta();

            //if status is incomplete
            if ($meta === EventHandler::STATUS_INCOMPLETE) {
                //we should also stop the flow
                return false;
            }
        });

        return $this;
    }
public function flow ( string $ event , ... $ flow ) { //listen for the main on global $ this -> on ( $ event , function ( ... $ args ) use ( & $ flow ) { $ this -> triggerFlow ( $ flow , ... $ args ) ; //analyze the meta $ meta = $ this -> getEventHandler ( ) -> getMeta ( ) ; //if status is incomplete if ( $ meta === EventHandler :: STATUS_INCOMPLETE ) { //we should also stop the flow return false ; } } ) ; return $ this ; }
Sets up a process flow

@param *string         $name     The name of this rule
@param string|callable ...$flow  An event name or callback

@return PipeTrait
Sets up a process flow