Code Duplication    Length = 12-14 lines in 2 locations

lib/classes/Swift/KeyCache/ArrayKeyCache.php 1 location

@@ 120-131 (lines=12) @@
117
     *
118
     * @return Swift_InputByteStream
119
     */
120
    public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $writeThrough = null)
121
    {
122
        $is = clone $this->_stream;
123
        $is->setKeyCache($this);
124
        $is->setNsKey($nsKey);
125
        $is->setItemKey($itemKey);
126
        if (isset($writeThrough)) {
127
            $is->setWriteThroughStream($writeThrough);
128
        }
129
130
        return $is;
131
    }
132
133
    /**
134
     * Get data back out of the cache as a string.

lib/classes/Swift/KeyCache/DiskKeyCache.php 1 location

@@ 156-169 (lines=14) @@
153
     *
154
     * @return Swift_InputByteStream
155
     */
156
    public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $writeThrough = null)
157
    {
158
        $is = clone $this->_stream;
159
160
        $is->setKeyCache($this);
161
        $is->setNsKey($nsKey);
162
        $is->setItemKey($itemKey);
163
164
        if (isset($writeThrough)) {
165
            $is->setWriteThroughStream($writeThrough);
166
        }
167
168
        return $is;
169
    }
170
171
    /**
172
     * Get data back out of the cache as a string.