Code Duplication    Length = 9-9 lines in 5 locations

src/Kunstmaan/GeneratorBundle/Command/GenerateEntityCommand.php 1 location

@@ 188-196 (lines=9) @@
185
    /**
186
     * @return bool
187
     */
188
    protected function askForWithRepository()
189
    {
190
        $withRepositoryOption = $this->assistant->getOption('with-repository');
191
        if ($withRepositoryOption != 'y' && $withRepositoryOption != 'n') {
192
            /** @var $question */
193
            $withRepositoryOption = $this->assistant->askConfirmation("\nDo you want to generate a repository class for the entity ? (y/n)\n", '', '?', false);
194
        }
195
196
        return $withRepositoryOption == 'y';
197
    }
198
}
199

src/Kunstmaan/GeneratorBundle/Command/GenerateArticleCommand.php 4 locations

@@ 238-246 (lines=9) @@
235
    /**
236
     * @return bool
237
     */
238
    protected function askForDummydata()
239
    {
240
        $dummydataOption = $this->assistant->getOption('dummydata');
241
        if ($dummydataOption != 'y' && $dummydataOption != 'n') {
242
            /** @var $question */
243
            $dummydataOption = $this->assistant->askConfirmation("\nDo you want to generate data fixtures to populate your database ? (y/n)\n", 'n', '?', false);
244
        }
245
246
        return $dummydataOption == 'y';
247
    }
248
249
    /**
@@ 252-260 (lines=9) @@
249
    /**
250
     * @return bool
251
     */
252
    protected function askForCategories()
253
    {
254
        $categoryOption = $this->assistant->getOption('with-category');
255
        if ($categoryOption != 'y' && $categoryOption != 'n') {
256
            /** @var $question */
257
            $categoryOption = $this->assistant->askConfirmation("\nDo you want to use categories ? (y/n)\n", 'y', '?', true);
258
        }
259
260
        return $categoryOption == 'y';
261
    }
262
263
    /**
@@ 266-274 (lines=9) @@
263
    /**
264
     * @return bool
265
     */
266
    protected function askForTags()
267
    {
268
        $tagOption = $this->assistant->getOption('with-tag');
269
        if ($tagOption != 'y' && $tagOption != 'n') {
270
            /** @var $question */
271
            $tagOption = $this->assistant->askConfirmation("\nDo you want to use tags ? (y/n)\n", 'y', '?', true);
272
        }
273
274
        return $tagOption == 'y';
275
    }
276
277
    /**
@@ 280-288 (lines=9) @@
277
    /**
278
     * @return bool
279
     */
280
    protected function askForAuthor()
281
    {
282
        $authorOption = $this->assistant->getOption('with-author');
283
        if ($authorOption != 'y' && $authorOption != 'n') {
284
            /** @var $question */
285
            $authorOption = $this->assistant->askConfirmation("\nDo you want to use authors ? (y/n)\n", 'y', '?', true);
286
        }
287
288
        return $authorOption == 'y';
289
    }
290
}
291