src/Stub/WhenChainCase.php
private function extractChainedMethodsBefore($methods, $currentMethod)
    {
        $chainedMethodsBefore = [];
        $currentMethodName = key($currentMethod);

        foreach ($methods as $method)
        {
            $methodName = key($method);

            if ($methodName == $currentMethodName) {
                break;
            }

            $chainedMethodsBefore[] = $method;
        }

        return $chainedMethodsBefore;
    }
private function extractChainedMethodsBefore($methods, $currentMethod)
    {
        $chainedMethodsBefore = [];
        $currentMethodName = key($currentMethod);

        foreach ($methods as $method)
        {
            $methodName = key($method);

            if ($methodName == $currentMethodName) {
                break;
            }

            $chainedMethodsBefore[] = $method;
        }

        return $chainedMethodsBefore;
    }
private function extractChainedMethodsBefore ( $ methods , $ currentMethod ) { $ chainedMethodsBefore = [ ] ; $ currentMethodName = key ( $ currentMethod ) ; foreach ( $ methods as $ method ) { $ methodName = key ( $ method ) ; if ( $ methodName == $ currentMethodName ) { break ; } $ chainedMethodsBefore [ ] = $ method ; } return $ chainedMethodsBefore ; }
Extracting chained methods before current method into an array

@param $methods
@param $currentMethod
@return array
Extracting chained methods before current method into an array