Code Duplication    Length = 12-12 lines in 3 locations

app/Ship/core/Generator/GeneratorCommand.php 3 locations

@@ 239-250 (lines=12) @@
236
     * @param null $default
237
     * @return array|string
238
     */
239
    protected function checkParameterOrAsk($param, $question, $default = null)
240
    {
241
        // check if we have already have a param set
242
        $value = $this->option($param);
243
        if($value == null)
244
        {
245
            // there was no value provided via CLI, so ask the user..
246
            $value = $this->ask($question, $default);
247
        }
248
249
        return $value;
250
    }
251
252
    /**
253
     * Checks if the param is set (via CLI), otherwise proposes choices to the user
@@ 261-272 (lines=12) @@
258
     * @param null $default
259
     * @return array|string
260
     */
261
    protected function checkParameterOrChoice($param, $question, $choices, $default = null)
262
    {
263
        // check if we have already have a param set
264
        $value = $this->option($param);
265
        if($value == null)
266
        {
267
            // there was no value provided via CLI, so ask the user..
268
            $value = $this->choice($question, $choices, $default);
269
        }
270
271
        return $value;
272
    }
273
274
    /**
275
     * @param      $param
@@ 281-292 (lines=12) @@
278
     *
279
     * @return mixed
280
     */
281
    protected function checkParameterOrConfirm($param, $question, $default = false)
282
    {
283
        // check if we have already have a param set
284
        $value = $this->option($param);
285
        if ($value === null)
286
        {
287
            // there was no value provided via CLI, so ask the user..
288
            $value = $this->confirm($question, $default);
289
        }
290
291
        return $value;
292
    }
293
294
    /**
295
     * Checks, if the data from the generator contains path, stub and file-parameters.