src/Utility/Validator.php
protected static function validateCriteria(array $data, array $fields): array
    {
        foreach (array_keys($data) as $key) {
            if (in_array($key, $fields)) {
                continue;
            }
            unset($data[$key]);
        }

        return $data;
    }
protected static function validateCriteria(array $data, array $fields): array
    {
        foreach (array_keys($data) as $key) {
            if (in_array($key, $fields)) {
                continue;
            }
            unset($data[$key]);
        }

        return $data;
    }
protected static function validateCriteria ( array $ data , array $ fields ) : array { foreach ( array_keys ( $ data ) as $ key ) { if ( in_array ( $ key , $ fields ) ) { continue ; } unset ( $ data [ $ key ] ) ; } return $ data ; }
Validate search criteria.

@param mixed[] $data Criteria values
@param mixed[] $fields Searchable fields
@return mixed[]
Validate search criteria .