PHPackages                             spartz/text-formatter - 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. spartz/text-formatter

Abandoned → [cmgmyr/title-formatter](/?search=cmgmyr%2Ftitle-formatter)Library[Utility &amp; Helpers](/categories/utility)

spartz/text-formatter
=====================

A simple to use text formatter, primarily used for page/blog titles

1.0.1(10y ago)05.8k11MITPHPPHP &gt;=5.4.0

Since Apr 27Pushed 10y ago7 watchersCompare

[ Source](https://github.com/SpartzInc/text-formatter)[ Packagist](https://packagist.org/packages/spartz/text-formatter)[ RSS](/packages/spartz-text-formatter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (1)

[![Build Status](https://camo.githubusercontent.com/fc11bb47c595dca4652b647946e7db9f01c7e771dbc9da6522cfc448cae18444/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f53706172747a496e632f746578742d666f726d61747465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/SpartzInc/text-formatter)[![Code Coverage](https://camo.githubusercontent.com/dafd2577762d069315965da3033daedeaffafbdf76853ebb38e5b5199fb339d5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f53706172747a496e632f746578742d666f726d61747465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/SpartzInc/text-formatter/code-structure/)[![Code Quality](https://camo.githubusercontent.com/a212265eeb63f8f7349e8c023e6f15a009f1f6aaf3340e600cb13c0660c393ac/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f53706172747a496e632f746578742d666f726d61747465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/SpartzInc/text-formatter/)[![Code Climate](https://camo.githubusercontent.com/c5b97455a76359e65ae39f7ce22e67c3aafba72b8beb8130f4c9a8730959a1e2/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6769746875622f53706172747a496e632f746578742d666f726d61747465722e7376673f7374796c653d666c61742d737175617265)](https://codeclimate.com/github/SpartzInc/text-formatter)[![Latest Version](https://camo.githubusercontent.com/8e5836898f225bba6674b1532e6dbafb2affc092fdc514dd92185559184f5881/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f53706172747a496e632f746578742d666f726d61747465722e7376673f7374796c653d666c61742d737175617265)](https://github.com/SpartzInc/text-formatter/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Title Text Formatter
====================

[](#title-text-formatter)

A simple to use text formatter, primarily used for page/blog titles.

Install
-------

[](#install)

Via Composer

```
"require": {
    "spartz/text-formatter": "~1.0"
}

```

Usage
-----

[](#usage)

```
use Spartz\TextFormatter\TextFormatter;

$title = "this is a messy title. [can you fix it?]";
$title = TextFormatter::titleCase($title);
echo $title; // This is a Messy Title. [Can You Fix It?]

```

Formatting "Rules"
------------------

[](#formatting-rules)

1. First word in a sentence is capitalized
2. Last word in a sentence is capitalized
3. Words within brackets (or similar) are capitalized, similar to rules #1 &amp; #2
4. Words within the `$ignoredWords` array should not be capitalized as long as it doesn't conflict with rules #1-#3
5. Words preceded by multiple special characters should be capitalized: $$$Money
6. All dashed words should be capitalized: Super-Awesome-Post
7. Ignore words that already include at least one uppercase letter. We'll assume that the author knows what they're doing: eBay, iPad, McCormick, etc

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email [Chris Gmyr](mailto:cgmyr@spartzinc.com) instead of using the issue tracker.

Credits
-------

[](#credits)

- [Chris Gmyr](https://github.com/cmgmyr)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity59

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

Total

2

Last Release

3850d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d987f3caa2f921deded28dc8cf4a6f8ecb6cd6acf79ebd5f7d6191835ba7f1a?d=identicon)[cmgmyr](/maintainers/cmgmyr)

---

Top Contributors

[![cmgmyr](https://avatars.githubusercontent.com/u/4693481?v=4)](https://github.com/cmgmyr "cmgmyr (28 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/spartz-text-formatter/health.svg)

```
[![Health](https://phpackages.com/badges/spartz-text-formatter/health.svg)](https://phpackages.com/packages/spartz-text-formatter)
```

###  Alternatives

[broadway/uuid-generator

UUID generator for broadway/broadway.

202.1M11](/packages/broadway-uuid-generator)

PHPackages © 2026

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