Code Duplication    Length = 22-24 lines in 2 locations

src/Request/Handler.php 2 locations

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