Code Duplication    Length = 11-11 lines in 2 locations

src/Connectors/Buffer.php 2 locations

@@ 128-138 (lines=11) @@
125
     * @param  boolean $retArray Enable return as array, otherwise will return a string
126
     * @return array|string
127
     */
128
    public function getDataBase64($retArray = true)
129
    {
130
        $lbuff = array();
131
        foreach ($this->buffer as $linha) {
132
            $lbuff[] = base64_encode($linha);
133
        }
134
        if (! $retArray) {
135
            return implode("\n", $lbuff);
136
        }
137
        return $lbuff;
138
    }
139
    
140
    /**
141
     * Returns the buffer data in JSON format
@@ 162-172 (lines=11) @@
159
     * @param  bool $retArray Enable return as array, otherwise will return a string
160
     * @return string|array
161
     */
162
    public function getDataReadable($retArray = true)
163
    {
164
        $ret = array();
165
        foreach ($this->buffer as $data) {
166
            $ret[] = $this->friendlyBinary($data);
167
        }
168
        if (! $retArray) {
169
            $ret = implode("\n", $ret);
170
        }
171
        return $ret;
172
    }
173
174
    /**
175
     * Converts unprintable characters in screen-printing characters