Code Duplication    Length = 6-10 lines in 2 locations

src/Controller/Frontend/TradingCardController.php 1 location

@@ 60-69 (lines=10) @@
57
        if ($this->getRequest()->isPost()) {
58
            $data = $this->getRequest()->getFiles()->toArray();
59
60
            if (empty($data)) {
61
                $data = $this->getRequest()->getPost()->toArray();
62
                $key = key($data);
63
                $uploadImage = array(
64
                    'name' => $key.'.png',
65
                    'error' => 0,
66
                    'base64' => $data[$key]
67
                );
68
                $data = array($key => $uploadImage);
69
            }
70
            $path = $this->getGameService()->getGameUserPath($this->game, $this->user);
71
            $media_url = '/'.$this->getGameService()->getGameUserMediaUrl($this->game, $this->user);
72
            $uploadFile = $this->getGameService()->uploadFile(

src/Controller/Frontend/PostVoteController.php 1 location

@@ 427-432 (lines=6) @@
424
        if ($this->getRequest()->isPost()) {
425
            $data = $this->getRequest()->getFiles()->toArray();
426
427
            if (empty($data)) {
428
                $data = $this->getRequest()->getPost()->toArray();
429
                $key = key($data);
430
                $uploadImage = array('name' => $key.'.png', 'error' => 0, 'base64' => $data[$key]);
431
                $data = array($key => $uploadImage);
432
            }
433
            $uploadFile = $this->getGameService()->uploadFileToPost(
434
                $data,
435
                $this->game,