Code Duplication    Length = 8-11 lines in 2 locations

src/Bundle/SculpinBundle/Command/GenerateCommand.php 2 locations

@@ 118-125 (lines=8) @@
115
//                $input->getOption('port')
116
//            );
117
118
            if ($watch) {
119
                $httpServer->addPeriodicTimer(1, function () use ($sourceSet) {
120
                    clearstatcache();
121
                    $sourceSet->reset();
122
123
                    $this->sculpin->run($this->compositeDataSource, $sourceSet);
124
                });
125
            }
126
127
            $httpServer->run();
128
        } else {
@@ 128-138 (lines=11) @@
125
            }
126
127
            $httpServer->run();
128
        } else {
129
            do {
130
                $this->sculpin->run($this->compositeDataSource, $sourceSet);
131
132
                if ($watch) {
133
                    sleep(2);
134
                    clearstatcache();
135
                    $sourceSet->reset();
136
                }
137
            } while ($watch);
138
        }
139
    }
140
141
    private function clean(OutputInterface $output, string $dir)