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

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

ailixter/gears-filter
=====================

The project, which gears Filter functions.

0.1.2(6y ago)01MITPHPPHP ^7

Since Nov 19Pushed 6y ago1 watchersCompare

[ Source](https://github.com/ailixter/gears-filter)[ Packagist](https://packagist.org/packages/ailixter/gears-filter)[ RSS](/packages/ailixter-gears-filter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

gears-filter
============

[](#gears-filter)

The project, which gears Filter functions.

Casts

- variable
- input GET, POST, etc.
- array

Cast $var into $type.

```
$filter = new Filter;
$int1 = $filter->cast(FILTER_VALIDATE_INT, '123');
$int2 = $filter->cast(['filter'=>FILTER_VALIDATE_INT, 'flags'=>...], '123');
$int3 = $filter->cast('int', '123');
```

Cast input $key into $type.

```
 $filter = new Filter;
 $int1 = $filter->castInput(FILTER_VALIDATE_INT, INPUT_POST, 'p');
 $int2 = $filter->castInput(['filter'=>FILTER_VALIDATE_INT, 'flags'=>...], INPUT_POST, 'p');
 $int3 = $filter->castInput('int', INPUT_POST, 'p');
```

Utility Filter-based class ArrayFilter

```
$array = new ArrayFilter(['a' => 123, 'b' => 'false'], new Filter);
$bool = $array->get('bool', 'b');
$float = $array->getFloat('a', 0.0);
$custom = $array->getCustomType('a');
$all = $array->castAll(['a' => 'float', 'b' => 'bool', 'undefined' => 'str']);
```

Utility Filter-based class InputFilter

```
$post = new InputFilter(INPUT_POST, new Filter);
$bool = $post->get('bool', 'b');
$float = $post->getFloat('a', 0.0);
$custom = $post->getCustomType('a');
$all = $post->castAll(['a' => 'float', 'b' => 'bool', 'undefined' => 'str']);
```

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Total

3

Last Release

2457d ago

### Community

Maintainers

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

---

Top Contributors

[![ailixter](https://avatars.githubusercontent.com/u/8529462?v=4)](https://github.com/ailixter "ailixter (9 commits)")

---

Tags

componentconfigconversionfilterinputparametersphprequestsanitizationtypecastvalidation

### Embed Badge

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

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

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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