src/HandlerList.php
private function sortMiddleware()
    {
        $this->sorted = [];

        if (!$this->interposeFn) {
            foreach ($this->steps as $step) {
                foreach ($step as $fn) {
                    $this->sorted[] = $fn[0];
                }
            }
            return;
        }

        $ifn = $this->interposeFn;
        // Interpose the interposeFn into the handler stack.
        foreach ($this->steps as $stepName => $step) {
            foreach ($step as $fn) {
                $this->sorted[] = $ifn($stepName, $fn[1]);
                $this->sorted[] = $fn[0];
            }
        }
    }
private function sortMiddleware()
    {
        $this->sorted = [];

        if (!$this->interposeFn) {
            foreach ($this->steps as $step) {
                foreach ($step as $fn) {
                    $this->sorted[] = $fn[0];
                }
            }
            return;
        }

        $ifn = $this->interposeFn;
        // Interpose the interposeFn into the handler stack.
        foreach ($this->steps as $stepName => $step) {
            foreach ($step as $fn) {
                $this->sorted[] = $ifn($stepName, $fn[1]);
                $this->sorted[] = $fn[0];
            }
        }
    }
private function sortMiddleware ( ) { $ this -> sorted = [ ] ; if ( ! $ this -> interposeFn ) { foreach ( $ this -> steps as $ step ) { foreach ( $ step as $ fn ) { $ this -> sorted [ ] = $ fn [ 0 ] ; } } return ; } $ ifn = $ this -> interposeFn ; // Interpose the interposeFn into the handler stack. foreach ( $ this -> steps as $ stepName => $ step ) { foreach ( $ step as $ fn ) { $ this -> sorted [ ] = $ ifn ( $ stepName , $ fn [ 1 ] ) ; $ this -> sorted [ ] = $ fn [ 0 ] ; } } }
Sort the middleware, and interpose if needed in the sorted list.
Sort the middleware and interpose if needed in the sorted list .