| Conditions | 3 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 57 | 22 | public static function addFilter($filter, $option) |
|
| 58 | { |
||
| 59 | 22 | if (self::$analyzer === null) { |
|
| 60 | 1 | self::$analyzer = new CaseInsensitive; |
|
| 61 | 1 | } |
|
| 62 | |||
| 63 | 22 | if (! in_array($filter, self::$filters )) { |
|
| 64 | 1 | self::$analyzer->addFilter(Factory::getFilter($filter, $option)); |
|
| 65 | 1 | self::$filters[] = $filter; |
|
| 66 | 1 | } |
|
| 67 | |||
| 68 | 22 | } |
|
| 69 | |||
| 78 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: