PHPackages                             district5/filter - 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. [Search &amp; Filtering](/categories/search)
4. /
5. district5/filter

ActiveLibrary[Search &amp; Filtering](/categories/search)

district5/filter
================

District5 Filter Library

3.0.0(2y ago)01662mitPHPPHP &gt;=7.1

Since Nov 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/district-5/php-filter)[ Packagist](https://packagist.org/packages/district5/filter)[ Docs](https://github.com/district-5/php-filter)[ RSS](/packages/district5-filter/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (8)Used By (2)

District5 Filter Library
========================

[](#district5-filter-library)

About
-----

[](#about)

This library provides the skeletons to support filters.

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

[](#installation)

This library requires no other libraries.

```
composer require district5/filter

```

Usage
-----

[](#usage)

### Filter

[](#filter)

All filters that implement the filter interface in this library must implement a `filter()` function that returns the filtered value, for example a filter to make a string lowercase might look as follows:

```
use \District5\Filter\FilterInterface;

class MyStringToLowerFilter implements FilterInterface
{
    public function filter($value)
    {
        if (extension_loaded('mbstring')) {
            return mb_strtolower($value);
        }

        return strtolower($value);
    }
}
```

Issues
------

[](#issues)

Log a bug report!

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

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

Recently: every ~525 days

Total

7

Last Release

858d ago

Major Versions

1.0.1 → 2.0.02018-05-25

2.1.1 → 3.0.02024-02-25

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

3.0.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/5de4b9a90eadf6b595e1b5efc802683f2358da5661c616820b90c922f8aa8e05?d=identicon)[rogerthomas84](/maintainers/rogerthomas84)

![](https://avatars.githubusercontent.com/u/1934581?v=4)[Mark Morgan](/maintainers/mark-morgan)[@mark-morgan](https://github.com/mark-morgan)

---

Top Contributors

[![mark-morgan](https://avatars.githubusercontent.com/u/1934581?v=4)](https://github.com/mark-morgan "mark-morgan (15 commits)")

---

Tags

phpfilterdistrict5

### Embed Badge

![Health badge](/badges/district5-filter/health.svg)

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

###  Alternatives

[phpsanitization/phpsanitization

Modern PHP Sanitization Library

181.8k](/packages/phpsanitization-phpsanitization)

PHPackages © 2026

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