Code Duplication    Length = 30-30 lines in 2 locations

src/Understand/UnderstandLaravel5/FieldProvider.php 2 locations

@@ 363-392 (lines=30) @@
360
    /**
361
     * @return array|null
362
     */
363
    protected function getQueryStringArray()
364
    {
365
        $enabled = $this->app['config']->get('understand-laravel.query_string_enabled');
366
367
        if ( ! $enabled)
368
        {
369
            return null;
370
        }
371
372
        if ( ! $this->request->query instanceof \IteratorAggregate)
373
        {
374
            return null;
375
        }
376
377
        $queryString = [];
378
379
        foreach($this->request->query as $key => $value)
380
        {
381
            try
382
            {
383
                $queryString[$key] = $this->parseRequestFieldValue($key, $value);
384
            }
385
            catch (\Exception $e)
386
            {
387
                $queryString[$key] = '[handler error]';
388
            }
389
        }
390
391
        return $queryString;
392
    }
393
394
    /**
395
     * @return array|null
@@ 397-426 (lines=30) @@
394
    /**
395
     * @return array|null
396
     */
397
    protected function getPostDataArray()
398
    {
399
        $enabled = $this->app['config']->get('understand-laravel.post_data_enabled');
400
401
        if ( ! $enabled)
402
        {
403
            return null;
404
        }
405
406
        if ( ! $this->request->request instanceof \IteratorAggregate)
407
        {
408
            return null;
409
        }
410
411
        $postData = [];
412
413
        foreach($this->request->request as $key => $value)
414
        {
415
            try
416
            {
417
                $postData[$key] = $this->parseRequestFieldValue($key, $value);
418
            }
419
            catch (\Exception $e)
420
            {
421
                $postData[$key] = '[handler error]';
422
            }
423
        }
424
425
        return $postData;
426
    }
427
428
    /**
429
     * @param $key