Code Duplication    Length = 3-3 lines in 2 locations

src/Simple.php 2 locations

@@ 862-864 (lines=3) @@
859
        $fh = fopen($pidFilename = $this->getPidFilename(), 'a');
860
861
        // append the PID to the PID file
862
        if (fwrite($fh, $pid . PHP_EOL) === false) {
863
            throw new \Exception(sprintf('Can\'t write PID %s to PID file %s', $pid, $pidFilename));
864
        }
865
866
        // close the file handle
867
        fclose($fh);
@@ 914-916 (lines=3) @@
911
912
        // append the existing PIDs to the PID file
913
        foreach ($pids as $pid) {
914
            if (fwrite($fh, $pid . PHP_EOL) === false) {
915
                throw new \Exception(sprintf('Can\'t write PID %s to PID file %s', $pid, $pidFilename));
916
            }
917
        }
918
919
        // finally close the PID file