Code Duplication    Length = 18-19 lines in 2 locations

src/Command/Generate/ModelCommand.php 1 location

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

src/Command/Generate/ModuleCommand.php 1 location

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