PHPackages                             jeroendesloovere/character-collection - 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. jeroendesloovere/character-collection

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

jeroendesloovere/character-collection
=====================================

Converts a sentence to a CharacterCollection

1.0.0(8y ago)19MITPHPPHP &gt;=7.1

Since Apr 3Pushed 8y ago1 watchersCompare

[ Source](https://github.com/jeroendesloovere/character-collection)[ Packagist](https://packagist.org/packages/jeroendesloovere/character-collection)[ Docs](https://github.com/jeroendesloovere/character-collection)[ RSS](/packages/jeroendesloovere-character-collection/feed)WikiDiscussions master Synced 2mo ago

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

Character collection
====================

[](#character-collection)

[![Latest Stable Version](https://camo.githubusercontent.com/6da9ab2e8fb7a9c25d96b709037c94ee6edc13e7862aa2006fc8729283d892fe/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a65726f656e6465736c6f6f766572652f6368617261637465722d636f6c6c656374696f6e2e737667)](https://packagist.org/packages/jeroendesloovere/character-collection)[![License](https://camo.githubusercontent.com/5a911ddcd16b9110e7821386ffd8d637005a8b856c14a3c0861b955e91da4eba/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d6c69676874677265792e737667)](https://github.com/jeroendesloovere/character-collection/blob/master/LICENSE)[![Build Status](https://camo.githubusercontent.com/6050df6da66775229a57af1efcc1a0bd827733b9e3858be60a08b3ad3cd676a7/68747470733a2f2f7472617669732d63692e6f72672f6a65726f656e6465736c6f6f766572652f6368617261637465722d636f6c6c656374696f6e2e7376673f6272616e63683d6e65772d76657273696f6e)](https://travis-ci.org/jeroendesloovere/character-collection)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b02ee8900edfc8bb12f63c6baf462de8f1bc174386f2b8a0e59bc894a91321a2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a65726f656e6465736c6f6f766572652f6368617261637465722d636f6c6c656374696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jeroendesloovere/character-collection/?branch=new-version)

> Use this class to read a sentence and get all the characters from it in a collection. So you know exactly how many times a character is being used in a sentence.

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

[](#installation)

```
composer require jeroendesloovere/character-collection

```

Example
-------

[](#example)

```
$collection = new CharacterCollection('This is my sentence.');
```

Which is a collection of all the characters that are used in your sentence + the positions that they are on. Example off how to get the positions of t

```
$collection->get('t')->getPositions();
```

> Will return `[0, 14]`.

Documentation
-------------

[](#documentation)

The class is well documented inline. If you use a decent IDE you'll see that each method is documented with PHPDoc.

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

[](#contributing)

Contributions are **welcome** and will be fully **credited**.

### Pull Requests

[](#pull-requests)

> To add or update code

- **Coding Syntax** - Please keep the code syntax consistent with the rest of the package.
- **Add unit tests!** - Your patch won't be accepted if it doesn't have tests.
- **Document any change in behavior** - Make sure the README and any other relevant documentation are kept up-to-date.
- **Consider our release cycle** - We try to follow [semver](http://semver.org/). Randomly breaking public APIs is not an option.
- **Create topic branches** - Don't ask us to pull from your master branch.
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.

### Issues

[](#issues)

> For bug reporting or code discussions.

More info on how to work with GitHub on help.github.com.

### Coding Syntax

[](#coding-syntax)

We use [squizlabs/php\_codesniffer](https://packagist.org/packages/squizlabs/php_codesniffer) to maintain the code standards. Type the following to execute them:

```
# To view the code errors
vendor/bin/phpcs --standard=psr2 --extensions=php --warning-severity=0 --report=full "src"

# OR to fix the code errors
vendor/bin/phpcbf --standard=psr2 --extensions=php --warning-severity=0 --report=full "src"
```

> [Read documentation about the code standards](https://github.com/squizlabs/PHP_CodeSniffer/wiki)

### Unit Tests

[](#unit-tests)

We have build in tests, type the following to execute them:

```
vendor/bin/phpunit tests
```

Credits
-------

[](#credits)

- [Jeroen Desloovere](https://github.com/jeroendesloovere)
- [All Contributors](https://github.com/jeroendesloovere/character-collection/contributors)

License
-------

[](#license)

The module is licensed under [MIT](./LICENSE.md). In short, this license allows you to do everything as long as the copyright statement stays present.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

2959d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/588616?v=4)[Jeroen Desloovere](/maintainers/jeroendesloovere)[@jeroendesloovere](https://github.com/jeroendesloovere)

---

Top Contributors

[![jeroendesloovere](https://avatars.githubusercontent.com/u/588616?v=4)](https://github.com/jeroendesloovere "jeroendesloovere (5 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/jeroendesloovere-character-collection/health.svg)

```
[![Health](https://phpackages.com/badges/jeroendesloovere-character-collection/health.svg)](https://phpackages.com/packages/jeroendesloovere-character-collection)
```

###  Alternatives

[jansenfelipe/cep-gratis

Com esse pacote você poderá realizar consultas de CEP gratuitamente.

689.4k](/packages/jansenfelipe-cep-gratis)[automattic/maintenance-mode-wp

Shut down your site for a little while and do some maintenance on it!

491.4k](/packages/automattic-maintenance-mode-wp)

PHPackages © 2026

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