Behat\Gherkin\Keywords\KeywordsDumper::dumpFeature PHP Method

dumpFeature() protected method

Dumps feature example.
protected dumpFeature ( string $keyword, boolean $short = true, $excludeAsterisk = false ) : string
$keyword string Item keyword
$short boolean Dump short version?
return string
    protected function dumpFeature($keyword, $short = true, $excludeAsterisk = false)
    {
        $dump = <<<GHERKIN
{$keyword}: Internal operations
  In order to stay secret
  As a secret organization
  We need to be able to erase past agents' memory


GHERKIN;
        // Background
        $keywords = explode('|', $this->keywords->getBackgroundKeywords());
        if ($short) {
            $keywords = call_user_func($this->keywordsDumper, $keywords, $short);
            $dump .= $this->dumpBackground($keywords, $short, $excludeAsterisk);
        } else {
            $keyword = call_user_func($this->keywordsDumper, array($keywords[0]), $short);
            $dump .= $this->dumpBackground($keyword, $short, $excludeAsterisk);
        }
        // Scenario
        $keywords = explode('|', $this->keywords->getScenarioKeywords());
        if ($short) {
            $keywords = call_user_func($this->keywordsDumper, $keywords, $short);
            $dump .= $this->dumpScenario($keywords, $short, $excludeAsterisk);
        } else {
            foreach ($keywords as $keyword) {
                $keyword = call_user_func($this->keywordsDumper, array($keyword), $short);
                $dump .= $this->dumpScenario($keyword, $short, $excludeAsterisk);
            }
        }
        // Outline
        $keywords = explode('|', $this->keywords->getOutlineKeywords());
        if ($short) {
            $keywords = call_user_func($this->keywordsDumper, $keywords, $short);
            $dump .= $this->dumpOutline($keywords, $short, $excludeAsterisk);
        } else {
            foreach ($keywords as $keyword) {
                $keyword = call_user_func($this->keywordsDumper, array($keyword), $short);
                $dump .= $this->dumpOutline($keyword, $short, $excludeAsterisk);
            }
        }
        return $dump;
    }