PHPackages                             siriusphp/filtration - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. siriusphp/filtration

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

siriusphp/filtration
====================

Data filtration library

2.0.0(6y ago)61.8k↓31.3%[1 issues](https://github.com/siriusphp/filtration/issues)MITPHPPHP &gt;=7.1CI failing

Since Mar 22Pushed 6y ago2 watchersCompare

[ Source](https://github.com/siriusphp/filtration)[ Packagist](https://packagist.org/packages/siriusphp/filtration)[ RSS](/packages/siriusphp-filtration/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (10)Used By (0)

\#Sirius\\Filtration

[![Source Code](https://camo.githubusercontent.com/cbcdfeab4dabc485ed91e6c931addafd7d4ec8ab624971259ef5516e69bb7f66/687474703a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d7369726975737068702f66696c74726174696f6e2d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/siriusphp/filtration)[![Latest Version](https://camo.githubusercontent.com/f7d28b15f0c6a48f443a44c9e0f9ac16c9c72aa6023244e34f5c3a013492e4e4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7369726975737068702f66696c74726174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/siriusphp/filtration/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/siriusphp/filtration/blob/master/LICENSE)[![Build Status](https://camo.githubusercontent.com/1ed65e1219028378b4c27b3c6c48388d9d99517a00c20f43490868fbb743608b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7369726975737068702f66696c74726174696f6e2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/siriusphp/filtration)[![Coverage Status](https://camo.githubusercontent.com/7b51931a3cf9d7d5156674a63f5a8788f71268633e800578baf1627832fbac25/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f7369726975737068702f66696c74726174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/siriusphp/filtration/code-structure)[![Quality Score](https://camo.githubusercontent.com/de3dbf842ebeef875012553a07fcd443ecf7580e21a699d5c62a38cffaf43091/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7369726975737068702f66696c74726174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/siriusphp/filtration)

PHP library for array filtering/sanitization

Sometimes you want to make sure the values pushed by a source (eg: a user when submits a form) follow some restrictions like

- no space at the beginning or the end for the title of a page
- no HTML code in a comment sent by a user
- no spaces in the field which represents the URL
- remove XSS attacks
- etc...

Other times you want to make sure that the data you send to the user is parsed before displaying. For example you may want to:

- convert markdown into HTML
- convert URLs into links
- apply a localized format to dates
- etc ()

To achieve this end result you need to filter the values. This is where SiriusFiltration comes into place

Elevator pitch
--------------

[](#elevator-pitch)

```
use Sirius\Filtration\Filtrator;

$filtrator = new Filtrator();

// add filters for title
$filtrator->add('title', 'trim');
$filtrator->add('title', 'strip_tags');
$filtrator->add('title', 'nullify');

// add filters for content in one go
$filtrator->add('content', [
	'trim'
]);

$result = $filtrator->filter(array(
	'title' => '   My title has tags and is awesome',
	'content' => '   My content was trimmed'
));

/* $result is
array(
	'title' => NULL ,
	'content' => 'My content was trimmed'
)
*/
```

Links
-----

[](#links)

- [documentation](http://www.sirius.ro/php/sirius/validation/)
- [changelog](CHANGELOG.md)

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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 ~270 days

Recently: every ~539 days

Total

9

Last Release

2319d ago

Major Versions

1.2.5 → 2.0.02020-02-23

PHP version history (2 changes)1.0.0PHP &gt;=5.4

2.0.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/e3de1fb0b661bb9affaf6283808f7e69e084827b7ef156c6d04ad261253b74dc?d=identicon)[adrianmiu](/maintainers/adrianmiu)

---

Top Contributors

[![adrianmiu](https://avatars.githubusercontent.com/u/1293017?v=4)](https://github.com/adrianmiu "adrianmiu (18 commits)")

---

Tags

securityforminputsanitizationfiltration

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/siriusphp-filtration/health.svg)

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

###  Alternatives

[siriusphp/validation

Data validation library. Validate arrays, array objects, domain models etc using a simple API. Easily add your own validators on top of the already dozens built-in validation rules

159763.3k13](/packages/siriusphp-validation)[progsmile/request-validator

Simple PHP Request Validator

33114.0k1](/packages/progsmile-request-validator)[aura/input

This package contains tools to describe and filter user inputs from an HTML form, including sub-forms/sub-fieldsets, fieldset collections, an interface for injecting custom filter systems, and CSRF protection. Note that this package does not include output functionality, although the "hints" provided by the Form object can be used with any presentation system to generate an HTML form.

6480.1k5](/packages/aura-input)[linio/input

Abstracts HTTP request input handling, providing an easy interface for data hydration and validation

3856.3k](/packages/linio-input)

PHPackages © 2026

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