Code Duplication    Length = 9-9 lines in 5 locations

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

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

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

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