<commit_before># sanitor
Sanitor is a thin wrapper around PHP's sanitization functions filter_…

## Goals

- Sanitor should be easy to use and easy to learn
- Sanitor should never implement its own fancy filters but just expose PHP's built-in functions in OOP-style

## Installation

The package is called broeser/sanitor and can be installed via composer:

composer require broeser/sanitor

## How to use

**IMPORTANT:** Sanitor does only sanitization – never try to use it as a
validation filter. It will not work as expected.

```PHP
<?php
/*
 * Example 1: Using filter()
 */
$value = '<EMAIL>';
$sanitizer = new Sanitor\Sanitizer(FILTER_SANITIZE_EMAIL);
$sanitizedValue = $sanitizer->filter($value);

/*
 * Example 2: Using filterPost()
 */
$sanitizer = new Sanitor\Sanitizer(FILTER_SANITIZE_EMAIL);
$email = $sanitizer->filterPost('email');
```

If you'd like to sanitize objects, just let their class implement 
SanitizableInterface and use the SanitizableTrait within them. You have to 
implement **getRawValue()** to return the "raw", unfiltered value of your <commit_msg>Tiny README-improvements<commit_after># Sanitor
Sanitor is a thin wrapper around PHP's sanitization functions filter_…

## Goals

- Sanitor should be easy to use and easy to learn
- Sanitor should never implement its own fancy filters but just expose PHP's 
  built-in functions in OOP-style

## Installation

The package is called broeser/sanitor and can be installed via composer:

composer require broeser/sanitor

## How to use

**IMPORTANT:** Sanitor does only sanitization – never try to use it as a
validation filter. It will not work as expected.

```PHP
<?php
/*
 * Example 1: Using filter()
 */
$value = '<EMAIL>';
$sanitizer = new Sanitor\Sanitizer(FILTER_SANITIZE_EMAIL);
$sanitizedValue = $sanitizer->filter($value);

/*
 * Example 2: Using filterPost()
 */
$sanitizer = new Sanitor\Sanitizer(FILTER_SANITIZE_EMAIL);
$email = $sanitizer->filterPost('email');
```

If you'd like to sanitize objects, just let their class implement 
SanitizableInterface and use the SanitizableTrait within them. You have to 
implement **getRawValue()** to return the "raw", unfiltered value of your 
{'fraction_non_alphanumeric': 0.09429622815087396, 'fraction_numerical': 0.0018399264029438822, 'mean_word_length': 4.9103260869565215, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3034887', 'n_tokens_mistral': 677, 'n_tokens_neox': 653, 'n_words': 263}