Code Duplication    Length = 22-24 lines in 2 locations

src/Request/Handler/Argument.php 2 locations

@@ 234-255 (lines=22) @@
231
     *
232
     * @return void
233
     */
234
    private function __argumentDecodeUTF8_mb_convert_encoding(&$mArg)
235
    {
236
        if(is_array($mArg))
237
        {
238
            foreach($mArg as $sKey => &$xArg)
239
            {
240
                $sNewKey = $sKey;
241
                $this->__argumentDecodeUTF8_mb_convert_encoding($sNewKey);
242
                if($sNewKey != $sKey)
243
                {
244
                    $mArg[$sNewKey] = $xArg;
245
                    unset($mArg[$sKey]);
246
                    $sKey = $sNewKey;
247
                }
248
                $this->__argumentDecodeUTF8_mb_convert_encoding($xArg);
249
            }
250
        }
251
        elseif(is_string($mArg))
252
        {
253
            $mArg = mb_convert_encoding($mArg, $this->getOption('core.encoding'), "UTF-8");
254
        }
255
    }
256
257
    /**
258
     * Decode an Jaxon request argument from UTF8
@@ 264-287 (lines=24) @@
261
     *
262
     * @return void
263
     */
264
    private function __argumentDecodeUTF8_utf8_decode(&$mArg)
265
    {
266
        if(is_array($mArg))
267
        {
268
            foreach($mArg as $sKey => &$xArg)
269
            {
270
                $sNewKey = $sKey;
271
                $this->__argumentDecodeUTF8_utf8_decode($sNewKey);
272
273
                if($sNewKey != $sKey)
274
                {
275
                    $mArg[$sNewKey] = $xArg;
276
                    unset($mArg[$sKey]);
277
                    $sKey = $sNewKey;
278
                }
279
280
                $this->__argumentDecodeUTF8_utf8_decode($xArg);
281
            }
282
        }
283
        elseif(is_string($mArg))
284
        {
285
            $mArg = utf8_decode($mArg);
286
        }
287
    }
288
289
    /**
290
     * Return the method that was used to send the arguments from the client