PHPackages                             italystrap/cleaner - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. italystrap/cleaner

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

italystrap/cleaner
==================

Data cleaner for PHP

1.2.0(6y ago)02991MITPHPPHP &gt;=7.0

Since Oct 14Pushed 6y ago1 watchersCompare

[ Source](https://github.com/ItalyStrap/cleaner)[ Packagist](https://packagist.org/packages/italystrap/cleaner)[ RSS](/packages/italystrap-cleaner/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (3)Dependencies (8)Versions (4)Used By (1)

ItalyStrap Cleaner API
======================

[](#italystrap-cleaner-api)

[![Build Status](https://camo.githubusercontent.com/0c75f4a52e5ff699147663afb32a2d7ac9f8bf67dbc73f880fa76c323e7b3101/68747470733a2f2f7472617669732d63692e6f72672f4974616c7953747261702f636c65616e65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ItalyStrap/cleaner)[![Latest Stable Version](https://camo.githubusercontent.com/ce7f8ea0858a37967ddda5ef99309bac1ec129f3dc7662e21417813b58e2cd37/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6974616c7973747261702f636c65616e65722e737667)](https://packagist.org/packages/italystrap/cleaner)[![Total Downloads](https://camo.githubusercontent.com/d1ebb7c217448303ff96fa83d7c65f98fd8817ce148b2e187105550694e4f3e0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6974616c7973747261702f636c65616e65722e737667)](https://packagist.org/packages/italystrap/cleaner)[![Latest Unstable Version](https://camo.githubusercontent.com/a0d0f7540076548c2b1a63f6eb62dd0d9abd1dfda7fa289bb440ff93a583273f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f6974616c7973747261702f636c65616e65722e737667)](https://packagist.org/packages/italystrap/cleaner)[![License](https://camo.githubusercontent.com/d56f6e5edfcc14de616e97f6bb10ea75680a6bc8c759256e78a91eee62abce72/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6974616c7973747261702f636c65616e65722e737667)](https://packagist.org/packages/italystrap/cleaner)[![PHP from Packagist](https://camo.githubusercontent.com/439c5e77ac2722d59821058211f143ce9d2d312e45a9233ce6deeb93929e5033/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6974616c7973747261702f636c65616e6572)](https://camo.githubusercontent.com/439c5e77ac2722d59821058211f143ce9d2d312e45a9233ce6deeb93929e5033/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6974616c7973747261702f636c65616e6572)

PHP Sanitizer and Validation OOP way

Table Of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Basic Usage](#basic-usage)
- [Advanced Usage](#advanced-usage)
- [Contributing](#contributing)
- [License](#license)

Installation
------------

[](#installation)

The best way to use this package is through Composer:

```
composer require italystrap/cleaner
```

Basic Usage
-----------

[](#basic-usage)

```
$sanitizator = new \ItalyStrap\Cleaner\Sanitization();
$validator = new \ItalyStrap\Cleaner\Validation();

$sanitizator->addRules( 'trim' );
// `Test`
echo $sanitizator->sanitize( ' Test ' );

// Single string rule
$rule = 'trim';
$sanitizator->addRules( $rule );
// `Test`
echo $sanitizator->sanitize( ' Test ' );

// Multiple rules in string
$rules = 'strip_tags|trim';
$sanitizator->addRules( $rules );
// `Test`
echo $sanitizator->sanitize( '  Test  ' );

// Multiple rules string in array
$rules_arr = [
	'strip_tags',
	'trim',
];
$sanitizator->addRules( $rules_arr );
// `Test`
echo $sanitizator->sanitize( '  Test  ' );

$callback = function ( $value ) {
	return  'New value from callback';
};

// Callable rule in array
$rule_callable = [
	$callback
];
$sanitizator->addRules( $rule_callable );
// `New value from callback`
echo $sanitizator->sanitize( '  Test  ' );

// Multiple callable rules in array
$rules_callable = [
	$callback,
	$callback,
];
$sanitizator->addRules( $rules_callable );
// `New value from callback`
echo $sanitizator->sanitize( '  Test  ' );
```

Every ::sanitize() or ::validate() call will reset the rules provided. Make sure you provide new rule befor calling ::sanitize() or ::validate().

Advanced Usage
--------------

[](#advanced-usage)

> TODO

Contributing
------------

[](#contributing)

All feedback / bug reports / pull requests are welcome.

License
-------

[](#license)

Copyright (c) 2019 Enea Overclokk, ItalyStrap

This code is licensed under the [MIT](LICENSE).

Credits
-------

[](#credits)

> TODO

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~37 days

Total

3

Last Release

2331d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/13d145319a065be260ee79e728655780ddd63002e5ac6c317701c8996ec8d94c?d=identicon)[overclokk](/maintainers/overclokk)

---

Top Contributors

[![overclokk](https://avatars.githubusercontent.com/u/4604932?v=4)](https://github.com/overclokk "overclokk (23 commits)")

---

Tags

phpwordpress-php-library

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/italystrap-cleaner/health.svg)

```
[![Health](https://phpackages.com/badges/italystrap-cleaner/health.svg)](https://phpackages.com/packages/italystrap-cleaner)
```

###  Alternatives

[germey/geetest

Geetest Package for Laravel5

15781.4k2](/packages/germey-geetest)[tonysm/tailwindcss-laravel

This package wraps up the standalone executable version of the Tailwind CSS framework.

26613.3k1](/packages/tonysm-tailwindcss-laravel)[rmunate/php2js

Effortlessly share PHP Laravel values with external JavaScript files using just one command, thanks to the seamless integration of PHP2JS.

2068.2k](/packages/rmunate-php2js)[fico7489/laravel-revisionable-upgrade

Upgrade for the venturecraft revisionable package, add many useful methods.

5339.2k](/packages/fico7489-laravel-revisionable-upgrade)[magiccart/magicslider

Banner slider flexibly to any page on live store.

1722.7k](/packages/magiccart-magicslider)[guennichi/mapper

A lightweight library to map array data to PHP immutable objects

1213.3k](/packages/guennichi-mapper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
