Code Duplication    Length = 16-18 lines in 2 locations

src/Webcreate/Conveyor/Task/ShellTask.php 1 location

@@ 53-70 (lines=18) @@
50
            $hasOutput = false;
51
52
            $self = $this;
53
            $outputter = function ($type, $buffer) use ($self, &$hasOutput) {
54
                if (false === $self->io->isVerbose()) return;
55
56
                if (1 || 'out' === $type) {
57
                    if (!$hasOutput) {
58
                        $this->io->write('');
59
                        $this->io->write('');
60
                        $hasOutput = true;
61
                    }
62
63
                    $lines = explode("\n", $buffer);
64
                    foreach ($lines as $line) {
65
                        if ($output = trim($line, "\r\n")) {
66
                            $self->io->write(sprintf('> %s', $output));
67
                        }
68
                    }
69
                }
70
            };
71
72
            if ($this->cli->execute($command, $outputter, $this->cwd) <> 0) {
73
                throw new ProcessFailedException($this->cli->getProcess());

src/Webcreate/Conveyor/Task/SshTask.php 1 location

@@ 61-76 (lines=16) @@
58
        $hasOutput = false;
59
60
        $self = $this;
61
        $outputter = function ($buffer) use ($self, &$hasOutput) {
62
            if (false === $self->io->isVerbose()) return;
63
64
            if (!$hasOutput) {
65
                $this->io->write('');
66
                $this->io->write('');
67
                $hasOutput = true;
68
            }
69
70
            $lines = explode("\n", $buffer);
71
            foreach ($lines as $line) {
72
                if ($output = trim($line, "\r\n")) {
73
                    $self->io->write(sprintf('> %s', $output));
74
                }
75
            }
76
        };
77
78
        if ($exitCode = $this->transporter->exec($command, $outputter) <> 0) {
79
            throw new \RuntimeException(