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

SanitizeDataProcessor   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 1 Features 1
Metric Value
wmc 3
c 2
b 1
f 1
lcom 0
cbo 1
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A sanitize() 0 9 3
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