Code Duplication    Length = 14-16 lines in 2 locations

src/TreeHouse/Feeder/Resource/FileResource.php 1 location

@@ 47-62 (lines=16) @@
44
    /**
45
     * @inheritdoc
46
     */
47
    public function getFile()
48
    {
49
        if ($this->file === null) {
50
            try {
51
                $this->file = $this->transport->getFile();
52
            } catch (\RuntimeException $e) {
53
                throw new TransportException(
54
                    sprintf('Could not open file "%s": %s', $this->transport->getDestination(), $e->getMessage()),
55
                    null,
56
                    $e
57
                );
58
            }
59
        }
60
61
        return $this->file;
62
    }
63
}
64

src/TreeHouse/Feeder/Resource/StringResource.php 1 location

@@ 52-65 (lines=14) @@
49
    /**
50
     * @inheritdoc
51
     */
52
    public function getFile()
53
    {
54
        if ($this->file === null) {
55
            try {
56
                $this->file = new TempFile();
57
                $this->file->fwrite($this->data);
58
                $this->file->fseek(0);
59
            } catch (\RuntimeException $e) {
60
                throw new TransportException($e->getMessage(), null, $e);
61
            }
62
        }
63
64
        return $this->file;
65
    }
66
}
67