src/HandlerList.php
private function add($step, $name, callable $middleware, $prepend = false)
    {
        $this->sorted = null;

        if ($prepend) {
            $this->steps[$step][] = [$middleware, $name];
        } else {
            array_unshift($this->steps[$step], [$middleware, $name]);
        }

        if ($name) {
            $this->named[$name] = $step;
        }
    }
private function add($step, $name, callable $middleware, $prepend = false)
    {
        $this->sorted = null;

        if ($prepend) {
            $this->steps[$step][] = [$middleware, $name];
        } else {
            array_unshift($this->steps[$step], [$middleware, $name]);
        }

        if ($name) {
            $this->named[$name] = $step;
        }
    }
private function add ( $ step , $ name , callable $ middleware , $ prepend = false ) { $ this -> sorted = null ; if ( $ prepend ) { $ this -> steps [ $ step ] [ ] = [ $ middleware , $ name ] ; } else { array_unshift ( $ this -> steps [ $ step ] , [ $ middleware , $ name ] ) ; } if ( $ name ) { $ this -> named [ $ name ] = $ step ; } }
Add a middleware to a step.

@param string   $step       Middleware step.
@param string   $name       Middleware name.
@param callable $middleware Middleware function to add.
@param bool     $prepend    Prepend instead of append.
Add a middleware to a step .