Code Duplication    Length = 11-13 lines in 3 locations

src/Runner/Simulate.php 3 locations

@@ 90-100 (lines=11) @@
87
     * @param  \phpbu\App\Backup\Collector     $collector
88
     * @throws \Exception
89
     */
90
    protected function simulateChecks(Configuration\Backup $backup, Target $target, Collector $collector)
91
    {
92
        foreach ($backup->getChecks() as $config) {
93
            $this->result->checkStart($config);
94
            $check = $this->factory->createCheck($config->type);
95
            if ($check instanceof Check\Simulator) {
96
                $check->simulate($target, $config->value, $collector, $this->result);
97
            }
98
            $this->result->checkEnd($config);
99
        }
100
    }
101
102
    /**
103
     * Simulate encryption.
@@ 109-120 (lines=12) @@
106
     * @param  \phpbu\App\Backup\Target        $target
107
     * @throws \phpbu\App\Exception
108
     */
109
    protected function simulateCrypt(Configuration\Backup $backup, Target $target)
110
    {
111
        if ($backup->hasCrypt()) {
112
            $crypt = $backup->getCrypt();
113
            $this->result->cryptStart($crypt);
114
            $crypter = $this->factory->createCrypter($crypt->type, $crypt->options);
115
            if ($crypter instanceof Crypter\Simulator) {
116
                $crypter->simulate($target, $this->result);
117
            }
118
            $this->result->cryptEnd($crypt);
119
        }
120
    }
121
122
    /**
123
     * Simulate all syncs.
@@ 148-160 (lines=13) @@
145
     * @param  \phpbu\App\Backup\Collector     $collector
146
     * @throws \phpbu\App\Exception
147
     */
148
    protected function simulateCleanup(Configuration\Backup $backup, Target $target, Collector $collector)
149
    {
150
        /* @var \phpbu\App\Configuration\Backup\Cleanup $cleanup */
151
        if ($backup->hasCleanup()) {
152
            $cleanup = $backup->getCleanup();
153
            $cleaner = $this->factory->createCleaner($cleanup->type, $cleanup->options);
154
            $this->result->cleanupStart($cleanup);
155
            if ($cleaner instanceof Cleaner\Simulator) {
156
                $cleaner->simulate($target, $collector, $this->result);
157
            }
158
            $this->result->cleanupEnd($cleanup);
159
        }
160
    }
161
162
    /**
163
     * Execute the compressor.