Code Duplication    Length = 7-9 lines in 3 locations

src/Behat/Gherkin/Keywords/KeywordsDumper.php 3 locations

@@ 118-124 (lines=7) @@
115
116
        // Background
117
        $keywords = explode('|', $this->keywords->getBackgroundKeywords());
118
        if ($short) {
119
            $keywords = call_user_func($this->keywordsDumper, $keywords, $short);
120
            $dump .= $this->dumpBackground($keywords, $short, $excludeAsterisk);
121
        } else {
122
            $keyword = call_user_func($this->keywordsDumper, array($keywords[0]), $short);
123
            $dump .= $this->dumpBackground($keyword, $short, $excludeAsterisk);
124
        }
125
126
        // Scenario
127
        $keywords = explode('|', $this->keywords->getScenarioKeywords());
@@ 128-136 (lines=9) @@
125
126
        // Scenario
127
        $keywords = explode('|', $this->keywords->getScenarioKeywords());
128
        if ($short) {
129
            $keywords = call_user_func($this->keywordsDumper, $keywords, $short);
130
            $dump .= $this->dumpScenario($keywords, $short, $excludeAsterisk);
131
        } else {
132
            foreach ($keywords as $keyword) {
133
                $keyword = call_user_func($this->keywordsDumper, array($keyword), $short);
134
                $dump .= $this->dumpScenario($keyword, $short, $excludeAsterisk);
135
            }
136
        }
137
138
        // Outline
139
        $keywords = explode('|', $this->keywords->getOutlineKeywords());
@@ 140-148 (lines=9) @@
137
138
        // Outline
139
        $keywords = explode('|', $this->keywords->getOutlineKeywords());
140
        if ($short) {
141
            $keywords = call_user_func($this->keywordsDumper, $keywords, $short);
142
            $dump .= $this->dumpOutline($keywords, $short, $excludeAsterisk);
143
        } else {
144
            foreach ($keywords as $keyword) {
145
                $keyword = call_user_func($this->keywordsDumper, array($keyword), $short);
146
                $dump .= $this->dumpOutline($keyword, $short, $excludeAsterisk);
147
            }
148
        }
149
150
        return $dump;
151
    }