Completed
Push — master ( 56fc22...f11276 )
by Thomas Mauro
06:14 queued 04:10
created

SanitizeDataProcessor::sanitize()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
c 2
b 1
f 1
dl 0
loc 9
rs 9.6666
cc 3
eloc 6
nc 3
nop 2
1
<?php
2
3
namespace Facile\SentryModule\Processor;
4
5
/**
6
 * Class SanitizeDataProcessor.
7
 */
8
class SanitizeDataProcessor extends \Raven_SanitizeDataProcessor
9
{
10
    /**
11
     * Replace any array values with our mask if the field name or the value matches a respective regex.
12
     *
13
     * @param mixed  $item Associative array value
14
     * @param string $key  Associative array key
15
     */
16
    public function sanitize(&$item, $key)
17
    {
18
        if (is_object($item)) {
19
            $item = 'Object '.get_class($item);
20
        } elseif (is_resource($item)) {
21
            return 'Resource '.get_resource_type($item);
22
        }
23
        parent::sanitize($item, $key);
24
    }
25
}
26