Skip to content

keboola/sanitizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sanitizer Build Status Maintainability Test Coverage

Sanitizes strings so that they are usable as column identifiers in Keboola Connection Storage.

Usage

Method sanitize generates a string which is a safe column name:

use Keboola\Utils\Sanitizer\ColumnNameSanitizer;

$sanitized = ColumnNameSanitizer::sanitize('my column name');
echo $sanitized; // prints 'my_column_name'

Method toAscii removes converts accented characters non-accented to fit into basic ASCII charset:

use Keboola\Utils\Sanitizer\ColumnNameSanitizer;

$sanitized = ColumnNameSanitizer::toAscii('test-vn-đá cuội');
echo $sanitized; // prints 'test_vn_da_cuoi'

License

MIT licensed, see LICENSE file.