Code Duplication    Length = 18-19 lines in 2 locations

src/Command/Generate/ModelCommand.php 1 location

@@ 110-127 (lines=18) @@
107
     * @return void
108
     * @throws \Bluzman\Generator\GeneratorException
109
     */
110
    public function verify(InputInterface $input, OutputInterface $output) : void
111
    {
112
        $model = $input->getArgument('model');
113
        $modelPath = $this->getApplication()->getModelPath($model);
114
115
        $paths = [
116
            $modelPath . DS . 'Table.php',
117
            $modelPath . DS . 'Row.php'
118
        ];
119
120
        foreach ($paths as $path) {
121
            if (!$this->getFs()->exists($path)) {
122
                throw new Generator\GeneratorException("File `$path` is not exists");
123
            }
124
        }
125
126
        $this->write(" |> Model <info>{$model}</info> has been successfully created.");
127
    }
128
}
129

src/Command/Generate/ModuleCommand.php 1 location

@@ 105-123 (lines=19) @@
102
     * @return void
103
     * @throws GeneratorException
104
     */
105
    public function verify(InputInterface $input, OutputInterface $output) : void
106
    {
107
        $module = $input->getArgument('module');
108
        $modulePath = $this->getApplication()->getModulePath($module);
109
110
        $paths = [
111
            $modulePath,
112
            $modulePath . DS . 'controllers',
113
            $modulePath . DS . 'views'
114
        ];
115
116
        foreach ($paths as $path) {
117
            if (!$this->getFs()->exists($path)) {
118
                throw new GeneratorException("Directory `$path` is not exists");
119
            }
120
        }
121
122
        $this->write(" |> Module <info>$module</info> has been successfully created.");
123
    }
124
}
125