Code Duplication    Length = 10-11 lines in 2 locations

lib/classes/Swift/CharacterStream/MbCharacterStream.php 1 location

@@ 86-95 (lines=10) @@
83
     *
84
     * @return int[]|bool
85
     */
86
    public function readBytes($length)
87
    {
88
        $read = $this->read($length);
89
90
        if ($read !== false) {
91
            return array_map('ord', str_split($read, 1));
92
        } else {
93
            return false;
94
        }
95
    }
96
97
    /**
98
     * @param Swift_CharacterReaderFactory $factory

lib/classes/Swift/CharacterStream/NgCharacterStream.php 1 location

@@ 222-232 (lines=11) @@
219
     *
220
     * @return integer[]|false false on error
221
     */
222
    public function readBytes($length)
223
    {
224
        $read = $this->read($length);
225
        if ($read !== false) {
226
            $ret = array_map('ord', str_split($read, 1));
227
228
            return $ret;
229
        }
230
231
        return false;
232
    }
233
234
    /**
235
     * @see Swift_CharacterStream::setPointer()