Code Duplication    Length = 16-17 lines in 6 locations

src/Command/Generate/ControllerCommand.php 1 location

@@ 44-60 (lines=17) @@
41
     * @param OutputInterface $output
42
     * @return void
43
     */
44
    protected function execute(InputInterface $input, OutputInterface $output) : void
45
    {
46
        $this->write('Running <info>generate:controller</info> command');
47
        try {
48
            // validate
49
            $this->validateModuleArgument();
50
            $this->validateControllerArgument();
51
52
            // generate directories and files
53
            $this->generate($input, $output);
54
55
            // verify it
56
            $this->verify($input, $output);
57
        } catch (\Exception $e) {
58
            $this->error("ERROR: {$e->getMessage()}");
59
        }
60
    }
61
62
    /**
63
     * @param InputInterface $input

src/Command/Generate/CrudCommand.php 1 location

@@ 47-63 (lines=17) @@
44
     * @return void
45
     * @throws \Bluzman\Generator\GeneratorException
46
     */
47
    protected function execute(InputInterface $input, OutputInterface $output) : void
48
    {
49
        $this->write('Running <info>generate:crud</info> command');
50
        try {
51
            // validate
52
            $this->validateModelArgument();
53
            $this->validateModuleArgument();
54
55
            // generate directories and files
56
            $this->generate($input, $output);
57
58
            // verify it
59
            $this->verify($input, $output);
60
        } catch (InputException $e) {
61
            $this->error("ERROR: {$e->getMessage()}");
62
        }
63
    }
64
65
    /**
66
     * @param InputInterface $input

src/Command/Generate/GridCommand.php 1 location

@@ 48-64 (lines=17) @@
45
     * @return void
46
     * @throws \Bluzman\Generator\GeneratorException
47
     */
48
    protected function execute(InputInterface $input, OutputInterface $output) : void
49
    {
50
        $this->write('Running <info>generate:grid</info> command');
51
        try {
52
            // validate
53
            $this->validateModelArgument();
54
            $this->validateModuleArgument();
55
56
            // generate directories and files
57
            $this->generate($input, $output);
58
59
            // verify files
60
            $this->verify($input, $output);
61
        } catch (InputException $e) {
62
            $this->error("ERROR: {$e->getMessage()}");
63
        }
64
    }
65
66
    /**
67
     * @param InputInterface $input

src/Command/Generate/ModelCommand.php 1 location

@@ 45-61 (lines=17) @@
42
     * @param OutputInterface $output
43
     * @return void
44
     */
45
    protected function execute(InputInterface $input, OutputInterface $output) : void
46
    {
47
        $this->write('Running <info>generate:model</info> command');
48
        try {
49
            // validate
50
            $this->validateModelArgument();
51
            $this->validateTableArgument();
52
53
            // generate directories and files
54
            $this->generate($input, $output);
55
56
            // verify it
57
            $this->verify($input, $output);
58
        } catch (InputException $e) {
59
            $this->error("ERROR: {$e->getMessage()}");
60
        }
61
    }
62
63
    /**
64
     * @param InputInterface $input

src/Command/Generate/ModuleCommand.php 1 location

@@ 43-58 (lines=16) @@
40
     * @param OutputInterface $output
41
     * @return void
42
     */
43
    protected function execute(InputInterface $input, OutputInterface $output)
44
    {
45
        $this->write('Running <info>generate:module</info> command');
46
        try {
47
            // validate
48
            $this->validateModuleArgument();
49
50
            // create main folder and subfolders
51
            $this->generate($input, $output);
52
53
            // verify it
54
            $this->verify($input, $output);
55
        } catch (\Exception $e) {
56
            $this->error("ERROR: {$e->getMessage()}");
57
        }
58
    }
59
60
    /**
61
     * @param InputInterface $input

src/Command/Generate/RestCommand.php 1 location

@@ 43-59 (lines=17) @@
40
    /**
41
     * {@inheritdoc}
42
     */
43
    protected function execute(InputInterface $input, OutputInterface $output) : void
44
    {
45
        $this->write('Running <info>generate:rest</info> command');
46
        try {
47
            // validate
48
            $this->validateModelArgument();
49
            $this->validateModuleArgument();
50
51
            // generate directories and files
52
            $this->generate($input, $output);
53
54
            // verify it
55
            $this->verify($input, $output);
56
        } catch (InputException $e) {
57
            $this->error("ERROR: {$e->getMessage()}");
58
        }
59
    }
60
61
    /**
62
     * @param InputInterface $input