PHPackages                             waynestate/string-middleware - 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. waynestate/string-middleware

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

waynestate/string-middleware
============================

Plugin based string manipulator

1.1.2(10y ago)032.1k↓29.8%1MITPHPPHP &gt;=5.3.0

Since Feb 15Pushed 10y ago14 watchersCompare

[ Source](https://github.com/waynestate/string-middleware)[ Packagist](https://packagist.org/packages/waynestate/string-middleware)[ Docs](http://github.com/waynestate/string-middleware)[ RSS](/packages/waynestate-string-middleware/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (10)Used By (1)

PHP String Manipulation Middleware
==================================

[](#php-string-manipulation-middleware)

Plugin based string manipulator

[![Build Status](https://camo.githubusercontent.com/65bfe8539a64a3dc3579ffc0d645fe2b41e43b1a2b10880c59dcf00709cef239/68747470733a2f2f7472617669732d63692e6f72672f7761796e6573746174652f737472696e672d6d6964646c65776172652e737667)](https://travis-ci.org/waynestate/string-middleware)

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

[](#installation)

To install this library, run the command below and you will get the latest version

```
composer require waynestate/string-middleware

```

Usage
-----

[](#usage)

```
// Start with some string
$input = 'Some string to parse';

// Create the instance of the Parser
$parser = new \Waynestate\ParserMiddleware\ParserMiddleware();

// Define the list of parsers to run, in chronological order
// Each must implement the Waynestate\StringParser\StringParserInterface
$parsers = array(
    'Waynestate\StringParser\SelfParser',
    'Waynestate\StringParsers\ReverseParser',
);

// Set the stack of parsers
$parser->setStack($parsers);

// Parse the string and return the output
$output = $parser->parse($input);

// Output is now modified by each parser
var_dump($output);

```

Example Parser
--------------

[](#example-parser)

Reverse a string

```
/**
 * Class Header Parser
 */
class HeaderParser implements Waynestate\StringParser\StringParserInterface
{
    /**
     * Replace every occurrence of "[header ...]" with "..."
     *
     * @param string $string
     * @return string
     */
    public function parse($string) {
        return preg_replace("/\[header (.*)\]/", '${1}', $string);
    }
}

```

Tests
-----

[](#tests)

```
phpunit

```

Code Coverage
-------------

[](#code-coverage)

```
phpunit --coverage-html ./coverage

```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 91.9% 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 ~24 days

Recently: every ~30 days

Total

6

Last Release

3988d ago

Major Versions

0.1.1 → 1.0.02015-03-18

### Community

Maintainers

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

---

Top Contributors

[![nickdenardis](https://avatars.githubusercontent.com/u/37359?v=4)](https://github.com/nickdenardis "nickdenardis (34 commits)")[![robertvrabel](https://avatars.githubusercontent.com/u/634788?v=4)](https://github.com/robertvrabel "robertvrabel (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/waynestate-string-middleware/health.svg)

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

###  Alternatives

[bpocallaghan/generators

Custom Laravel File Generators with config and publishable stubs.

11965.8k3](/packages/bpocallaghan-generators)[solbianca/yii2-fias

Fias base for your site

142.0k](/packages/solbianca-yii2-fias)

PHPackages © 2026

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