PHPackages                             wikimedia/wrappedstring - 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. wikimedia/wrappedstring

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

wikimedia/wrappedstring
=======================

Automatically compact sequentially-outputted strings that share a common prefix / suffix pair.

v4.1.0(6mo ago)4851.8k↑17.8%1MITPHPPHP &gt;=8.1

Since Jul 30Pushed 2mo ago14 watchersCompare

[ Source](https://github.com/wikimedia/WrappedString)[ Packagist](https://packagist.org/packages/wikimedia/wrappedstring)[ Docs](https://www.mediawiki.org/wiki/WrappedString)[ RSS](/packages/wikimedia-wrappedstring/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (13)Used By (1)

WrappedString
=============

[](#wrappedstring)

WrappedString is a small PHP library for compacting redundant string-wrapping code in text output. The most common use-case is to eliminate redundant runs of HTML open/close tags and JavaScript boilerplate.

Here is how you use it:

```
use Wikimedia\WrappedString;

$buffer = [
	new WrappedString( '[foo]', '[', ']' ),
	new WrappedString( '[bar]', '[', ']' ),
];
$output = WrappedString::join( "\n", $buffer );
// Result: '[foobar]'
```

License
-------

[](#license)

The project is licensed under the MIT license.

###  Health Score

59

—

FairBetter than 99% of packages

Maintenance78

Regular maintenance activity

Popularity40

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~677 days

Total

12

Last Release

195d ago

Major Versions

v1.0.0 → v2.0.02015-07-31

v2.3.0 → v3.0.02018-05-23

v3.2.0 → v4.0.02020-02-29

PHP version history (4 changes)v1.0.0PHP &gt;=5.3.3

v2.1.0PHP &gt;=5.5.9

v3.2.0PHP &gt;=7.2.9

v4.1.0PHP &gt;=8.1

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/716c86d71cbf921e7912a505f89d799de398fc0a3af0bd4c8862834b2d642bd7?d=identicon)[wikimedia](/maintainers/wikimedia)

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

---

Top Contributors

[![Krinkle](https://avatars.githubusercontent.com/u/156867?v=4)](https://github.com/Krinkle "Krinkle (20 commits)")[![jdforrester](https://avatars.githubusercontent.com/u/881572?v=4)](https://github.com/jdforrester "jdforrester (15 commits)")[![umherirrender](https://avatars.githubusercontent.com/u/1174884?v=4)](https://github.com/umherirrender "umherirrender (9 commits)")[![reedy](https://avatars.githubusercontent.com/u/67615?v=4)](https://github.com/reedy "reedy (8 commits)")[![legoktm](https://avatars.githubusercontent.com/u/81392?v=4)](https://github.com/legoktm "legoktm (4 commits)")[![bd808](https://avatars.githubusercontent.com/u/6469?v=4)](https://github.com/bd808 "bd808 (3 commits)")[![atdt](https://avatars.githubusercontent.com/u/376462?v=4)](https://github.com/atdt "atdt (2 commits)")[![DannyS712](https://avatars.githubusercontent.com/u/46829944?v=4)](https://github.com/DannyS712 "DannyS712 (1 commits)")[![Daimona](https://avatars.githubusercontent.com/u/38216014?v=4)](https://github.com/Daimona "Daimona (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wikimedia-wrappedstring/health.svg)

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

PHPackages © 2026

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