PHPackages                             kaiseki/string-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. kaiseki/string-filter

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

kaiseki/string-filter
=====================

Composable string filters with a filter pipeline.

1.0.1(1mo ago)0772MITPHPPHP ^8.2CI passing

Since May 29Pushed 3w ago2 watchersCompare

[ Source](https://github.com/kaisekidev/kaiseki-string-filter)[ Packagist](https://packagist.org/packages/kaiseki/string-filter)[ Docs](https://github.com/kaisekidev/kaiseki-string-filter)[ RSS](/packages/kaiseki-string-filter/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (16)Versions (9)Used By (0)

kaiseki/string-filter
=====================

[](#kaisekistring-filter)

Composable string filters with a simple pipeline.

A filter is any object implementing `StringFilterInterface` — `__invoke(string): string`. `StringFilterPipeline` chains filters and applies them left to right, so transformations compose cleanly (and pipelines nest, since the pipeline is itself a filter). The package ships a few ready-made filters for tidying up markup/punctuation artifacts.

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

[](#installation)

```
composer require kaiseki/string-filter
```

Requires PHP 8.2 or newer.

Usage
-----

[](#usage)

```
use Kaiseki\StringFilter\RemoveDanglingColon;
use Kaiseki\StringFilter\RemoveDoubleSquareBracketsStringFilter;
use Kaiseki\StringFilter\StringFilterPipeline;

$filter = new StringFilterPipeline(
    new RemoveDoubleSquareBracketsStringFilter(), // "[[Title]]" -> "Title"
    new RemoveDanglingColon(),                    // "Title:"    -> "Title"
);

echo $filter('[[Title]]:'); // "Title"
```

Included filters
----------------

[](#included-filters)

FilterBehavior`StringFilterPipeline`Apply several filters in sequence.`PregReplaceStringFilter``preg_replace` with matching `pattern`/`replacement` lists (throws if their lengths differ).`RemoveDanglingColon`Strip a trailing colon: `Title:` → `Title`.`RemoveDoubleSquareBracketsStringFilter`Unwrap `[[ … ]]`: `[[x]]` → `x`.`RemoveDoubleCurlyBracketsStringFilter`Unwrap `{{ … }}`.`RemoveDoubleRoundBracketsStringFilter`Unwrap `(( … ))`.`RemoveDoubleAngleBracketsStringFilter`Unwrap `>`.Write your own by implementing `StringFilterInterface`:

```
use Kaiseki\StringFilter\StringFilterInterface;

final class Uppercase implements StringFilterInterface
{
    public function __invoke(string $string): string
    {
        return strtoupper($string);
    }
}
```

Development
-----------

[](#development)

```
composer install
composer check   # check-deps, cs-check, phpstan
```

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance94

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.2% 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 ~0 days

Total

2

Last Release

35d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c3a6b11aea9668c9e9ca0c0f8515ef114d344acb552c695d715d35d5b388ea4?d=identicon)[woda](/maintainers/woda)

---

Top Contributors

[![wolfgangschaefer](https://avatars.githubusercontent.com/u/26325205?v=4)](https://github.com/wolfgangschaefer "wolfgangschaefer (9 commits)")[![davidmondok](https://avatars.githubusercontent.com/u/3883758?v=4)](https://github.com/davidmondok "davidmondok (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

PHPackages © 2026

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