src/Helpers/Clean.php
public static function run($value, string $type = null)
    {
        switch ($type) {
            case 'int':
                $regexp = self::compileRegexp(self::INT);
                break;
            case 'float':
                $regexp = self::compileRegexp(self::FLOAT);
                break;
            case 'text':
                $value = self::fixQuotes($value);
                $regexp = self::compileRegexp(self::CHARS_RUS . self::CHARS_ENG);
                break;
            default:
                $value = self::fixQuotes($value);
                $regexp = self::compileRegexp(
                    self::CHARS_RUS . self::CHARS_ENG . self::FLOAT .
                    '—~`@%[]/:<>;?&()_!$^-+=' . self::SUPER
                );
                break;
        }

        return preg_replace($regexp, '', $value);
    }
public static function run($value, string $type = null)
    {
        switch ($type) {
            case 'int':
                $regexp = self::compileRegexp(self::INT);
                break;
            case 'float':
                $regexp = self::compileRegexp(self::FLOAT);
                break;
            case 'text':
                $value = self::fixQuotes($value);
                $regexp = self::compileRegexp(self::CHARS_RUS . self::CHARS_ENG);
                break;
            default:
                $value = self::fixQuotes($value);
                $regexp = self::compileRegexp(
                    self::CHARS_RUS . self::CHARS_ENG . self::FLOAT .
                    '—~`@%[]/:<>;?&()_!$^-+=' . self::SUPER
                );
                break;
        }

        return preg_replace($regexp, '', $value);
    }
public static function run ( $ value , string $ type = null ) { switch ( $ type ) { case 'int' : $ regexp = self :: compileRegexp ( self :: INT ) ; break ; case 'float' : $ regexp = self :: compileRegexp ( self :: FLOAT ) ; break ; case 'text' : $ value = self :: fixQuotes ( $ value ) ; $ regexp = self :: compileRegexp ( self :: CHARS_RUS . self :: CHARS_ENG ) ; break ; default : $ value = self :: fixQuotes ( $ value ) ; $ regexp = self :: compileRegexp ( self :: CHARS_RUS . self :: CHARS_ENG . self :: FLOAT . '—~`@%[]/:<>;?&()_!$^-+=' . s lf:: SU PER ) ; break ; } return preg_replace ( $ regexp , '' , $ value ) ; }
Cleanup the value

@param   string|int|null $value
@param   string $type
@return  mixed
Cleanup the value