Code Duplication    Length = 29-29 lines in 2 locations

app/Satis/Context/AsyncCommand.php 1 location

@@ 13-41 (lines=29) @@
10
/**
11
 * @author Lukas Homza <[email protected]>
12
 */
13
class AsyncCommand implements CommandContextInterface {
14
    /**
15
     * @param string $logFile
16
     * @return string
17
     */
18
    public function getOutputRedirection($logFile) {
19
        return '&> ' . escapeshellarg($logFile);
20
    }
21
22
	/**
23
     * @return string
24
     */
25
    public function getShouldUnlockOnCompletion() {
26
        return ' && php artisan satis:persister:unlock';
27
    }
28
29
    /**
30
     * @return \Monolog\Logger
31
     */
32
    public function getLogger() {
33
        $handler = new StreamHandler(storage_path('logs/builder_async.log'), Logger::DEBUG);
34
        $handler->setFormatter(new LineFormatter(null, null, true, true));
35
36
        $logger = new Logger('AsyncBuildLog');
37
        $logger->pushHandler($handler);
38
39
        return $logger;
40
    }
41
}
42

app/Satis/Context/SyncCommand.php 1 location

@@ 13-41 (lines=29) @@
10
/**
11
 * @author Lukas Homza <[email protected]>
12
 */
13
class SyncCommand implements CommandContextInterface {
14
    /**
15
     * @param string $logFile
16
     * @return string
17
     */
18
    public function getOutputRedirection($logFile) {
19
        return '';
20
    }
21
22
    /**
23
     * @return string
24
     */
25
    public function getShouldUnlockOnCompletion() {
26
        return '';
27
    }
28
29
    /**
30
     * @return \Monolog\Logger
31
     */
32
    public function getLogger() {
33
        $handler = new StreamHandler(storage_path('logs/builder_sync.log'), Logger::DEBUG);
34
        $handler->setFormatter(new LineFormatter(null, null, true, true));
35
36
        $logger = new Logger('SyncBuildLog');
37
        $logger->pushHandler($handler);
38
39
        return $logger;
40
    }
41
}
42