src/FlexPress/Components/Routing/Route.php
public function run()
    {
        if (!isset($this->conditions)
            || !isset($this->callable)
        ) {

            $message = "You have called the run function but have not provided both a array of conditions";
            $message .= " and a callable function, which will be called if all the given conditions are met.";

            throw new \RuntimeException($message);
        }

        $this->conditions->rewind();
        while ($this->conditions->valid()) {

            $condition = $this->conditions->current();

            if (!call_user_func($condition)) {
                return false;
            }

            $this->conditions->next();
        }

        call_user_func($this->callable, $this->request);
        return true;

    }
public function run()
    {
        if (!isset($this->conditions)
            || !isset($this->callable)
        ) {

            $message = "You have called the run function but have not provided both a array of conditions";
            $message .= " and a callable function, which will be called if all the given conditions are met.";

            throw new \RuntimeException($message);
        }

        $this->conditions->rewind();
        while ($this->conditions->valid()) {

            $condition = $this->conditions->current();

            if (!call_user_func($condition)) {
                return false;
            }

            $this->conditions->next();
        }

        call_user_func($this->callable, $this->request);
        return true;

    }
public function run ( ) { if ( ! isset ( $ this -> conditions ) || ! isset ( $ this -> callable ) ) { $ message = "You have called the run function but have not provided both a array of conditions" ; $ message .= " and a callable function, which will be called if all the given conditions are met." ; throw new \ RuntimeException ( $ message ) ; } $ this -> conditions -> rewind ( ) ; while ( $ this -> conditions -> valid ( ) ) { $ condition = $ this -> conditions -> current ( ) ; if ( ! call_user_func ( $ condition ) ) { return false ; } $ this -> conditions -> next ( ) ; } call_user_func ( $ this -> callable , $ this -> request ) ; return true ; }
Runs through all the callable functions provided, if all are met call the given callable
@author Tim Perry
Runs through all the callable functions provided if all are met call the given callable