public function withFilteredSteps(callable $matcher)
    {
        $clone = clone $this;

        foreach ($clone->stages as $stage => &$steps) {
            $steps = array_filter($steps, function ($step) use ($matcher, $stage) {
                return $matcher($stage, $step);
            });
        }

        return $clone;
    }
public function withFilteredSteps(callable $matcher)
    {
        $clone = clone $this;

        foreach ($clone->stages as $stage => &$steps) {
            $steps = array_filter($steps, function ($step) use ($matcher, $stage) {
                return $matcher($stage, $step);
            });
        }

        return $clone;
    }
public function withFilteredSteps ( callable $ matcher ) { $ clone = clone $ this ; foreach ( $ clone -> stages as $ stage => & $ steps ) { $ steps = array_filter ( $ steps , function ( $ step ) use ( $ matcher , $ stage ) { return $ matcher ( $ stage , $ step ) ; } ) ; } return $ clone ; }
Return a query builder with some steps removed.

@param callable $matcher
@return static
Return a query builder with some steps removed .