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

@@ 439-444 (lines=6) @@
436
        if ($this->getRequest()->isPost()) {
437
            $data = $this->getRequest()->getFiles()->toArray();
438
439
            if (empty($data)) {
440
                $data = $this->getRequest()->getPost()->toArray();
441
                $key = key($data);
442
                $uploadImage = array('name' => $key.'.png', 'error' => 0, 'base64' => $data[$key]);
443
                $data = array($key => $uploadImage);
444
            }
445
            $uploadFile = $this->getGameService()->uploadFileToPost(
446
                $data,
447
                $this->game,