Utils   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

Changes 4
Bugs 1 Features 1
Metric Value
eloc 4
c 4
b 1
f 1
dl 0
loc 7
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A escape() 0 5 1
1
<?php
2
3
4
namespace Manticoresearch;
5
6
trait Utils
7
{
8
    public static function escape($string): string
9
    {
10
        $from = ['\\', '(',')','|','-','!','@','~','"','&', '/', '^', '$', '=', '<'];
11
        $to = ['\\\\', '\(','\)','\|','\-','\!','\@','\~','\"', '\&', '\/', '\^', '\$', '\=', '\<'];
12
        return str_replace($from, $to, $string);
13
    }
14
}
15