Code Duplication    Length = 22-22 lines in 2 locations

src/RunOpenCode/Backup/Workflow/Name.php 1 location

@@ 37-58 (lines=22) @@
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function execute()
38
    {
39
        try {
40
41
            $this->backup->setName($this->profile->getNamer()->getName());
42
            $this->getEventDispatcher()->dispatch(BackupEvents::NAME, new BackupEvent($this, $this->profile, $this->backup, $this));
43
44
        } catch (\Exception $e) {
45
46
            $this->getLogger()->error(sprintf('Could not set name of new backup for profile "%s".', $this->profile->getName()), array(
47
                'message' => $e->getMessage(),
48
                'code' => $e->getCode(),
49
                'file' => $e->getFile(),
50
                'line' => $e->getLine(),
51
                'trace' => $e->getTrace()
52
            ));
53
54
            throw $e;
55
        }
56
57
        $this->getLogger()->info(sprintf('Naming successfully completed, backup name: "%s".', $this->backup->getName()));
58
    }
59
}
60

src/RunOpenCode/Backup/Workflow/Push.php 1 location

@@ 37-58 (lines=22) @@
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function execute()
38
    {
39
        try {
40
41
            $this->profile->getDestination()->push($this->backup);
42
43
            $this->getLogger()->info(sprintf('Backup "%s" successfully pushed to destination.', $this->backup->getName()));
44
            $this->getEventDispatcher()->dispatch(BackupEvents::PUSH, new BackupEvent($this, $this->profile, $this->backup, $this));
45
46
        } catch (\Exception $e) {
47
48
            $this->getLogger()->error(sprintf('Could not push backup to destination for profile "%s".', $this->profile->getName()), array(
49
                'message' => $e->getMessage(),
50
                'code' => $e->getCode(),
51
                'file' => $e->getFile(),
52
                'line' => $e->getLine(),
53
                'trace' => $e->getTrace()
54
            ));
55
56
            throw $e;
57
        }
58
    }
59
}
60