Code Duplication    Length = 3-3 lines in 2 locations

src/Controller/Admin/LotteryController.php 1 location

@@ 49-51 (lines=3) @@
46
            if (empty($data['prizes'])) {
47
                $data['prizes'] = array();
48
            }
49
            if (isset($data['drawDate']) && $data['drawDate']) {
50
                $data['drawDate'] = \DateTime::createFromFormat('d/m/Y', $data['drawDate']);
51
            }
52
            $game = $service->createOrUpdate($data, $lottery, 'playgroundgame_lottery_form');
53
            if ($game) {
54
                $this->flashMessenger()->setNamespace('playgroundgame')->addMessage('The game was created');

src/Controller/Admin/GameController.php 1 location

@@ 235-237 (lines=3) @@
232
            if (empty($data['prizes'])) {
233
                $data['prizes'] = array();
234
            }
235
            if (isset($data['drawDate']) && $data['drawDate']) {
236
                $data['drawDate'] = \DateTime::createFromFormat('d/m/Y', $data['drawDate']);
237
            }
238
            $game = $this->getAdminGameService()->createOrUpdate($data, $this->game, $formId);
239
240
            if ($game) {