src/Behat/Behat/Context/Snippet/Generator/ContextSnippetGenerator.php
private function getMethodNameNotProposedEarlier($contextClass, $stepPattern, $name, $number)
    {
        foreach ($this->getAlreadyProposedMethods($contextClass) as $proposedPattern => $proposedMethod) {
            if ($proposedPattern === $stepPattern) {
                continue;
            }

            while ($proposedMethod === $name) {
                $name = preg_replace('/\d+$/', '', $name);
                $name .= $number++;
            }
        }

        $this->markMethodAsAlreadyProposed($contextClass, $stepPattern, $name);

        return $name;
    }
private function getMethodNameNotProposedEarlier($contextClass, $stepPattern, $name, $number)
    {
        foreach ($this->getAlreadyProposedMethods($contextClass) as $proposedPattern => $proposedMethod) {
            if ($proposedPattern === $stepPattern) {
                continue;
            }

            while ($proposedMethod === $name) {
                $name = preg_replace('/\d+$/', '', $name);
                $name .= $number++;
            }
        }

        $this->markMethodAsAlreadyProposed($contextClass, $stepPattern, $name);

        return $name;
    }
private function getMethodNameNotProposedEarlier ( $ contextClass , $ stepPattern , $ name , $ number ) { foreach ( $ this -> getAlreadyProposedMethods ( $ contextClass ) as $ proposedPattern => $ proposedMethod ) { if ( $ proposedPattern === $ stepPattern ) { continue ; } while ( $ proposedMethod === $ name ) { $ name = preg_replace ( '/\d+$/' , '' , $ name ) ; $ name .= $ number ++ ; } } $ this -> markMethodAsAlreadyProposed ( $ contextClass , $ stepPattern , $ name ) ; return $ name ; }
Tries to guess method name that is not yet proposed to the context class.

@param string  $contextClass
@param string  $stepPattern
@param string  $name
@param integer $number

@return string
Tries to guess method name that is not yet proposed to the context class .