Code Duplication    Length = 42-43 lines in 2 locations

app/Console/Commands/setReldate.php 1 location

@@ 14-56 (lines=43) @@
11
use App\Helpers\DatabaseHelper;
12
use Illuminate\Console\Command;
13
14
class setReldate extends Command
15
{
16
    /**
17
     * The name and signature of the console command.
18
     *
19
     * @var string
20
     */
21
    protected $signature = 'set:reldate';
22
23
    /**
24
     * The console command description.
25
     *
26
     * @var string
27
     */
28
    protected $description = 'set releasedate from gamefiles';
29
30
    /**
31
     * Create a new command instance.
32
     *
33
     * @return void
34
     */
35
    public function __construct()
36
    {
37
        parent::__construct();
38
    }
39
40
    /**
41
     * Execute the console command.
42
     *
43
     * @return mixed
44
     */
45
    public function handle()
46
    {
47
        $games = Game::all();
48
49
        foreach ($games as $g) {
50
            $this->info('Setze Releasedate für: '.$g->title);
51
            DatabaseHelper::setReleaseInfos($g->id);
52
        }
53
54
        $this->info('Fertig.');
55
    }
56
}
57

app/Console/Commands/setVotes.php 1 location

@@ 14-55 (lines=42) @@
11
use App\Helpers\DatabaseHelper;
12
use Illuminate\Console\Command;
13
14
class setVotes extends Command
15
{
16
    /**
17
     * The name and signature of the console command.
18
     *
19
     * @var string
20
     */
21
    protected $signature = 'set:votes';
22
23
    /**
24
     * The console command description.
25
     *
26
     * @var string
27
     */
28
    protected $description = 'speichert votes und comments in gametable';
29
30
    /**
31
     * Create a new command instance.
32
     *
33
     * @return void
34
     */
35
    public function __construct()
36
    {
37
        parent::__construct();
38
    }
39
40
    /**
41
     * Execute the console command.
42
     *
43
     * @return mixed
44
     */
45
    public function handle()
46
    {
47
        $games = Game::all();
48
49
        foreach ($games as $game) {
50
            $this->info('Setze Releasedate für: '.$game->title);
51
            DatabaseHelper::setVotesAndComments($game->id);
52
        }
53
        $this->info('Fertig!');
54
    }
55
}
56