PHPackages                             seworqs/commons-string - 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. seworqs/commons-string

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

seworqs/commons-string
======================

A modern PHP utility library for string manipulation, including case conversion, namespace formatting, path handling, and secure random string generation.

2.0.0(1y ago)0122Apache-2.0PHPPHP ^8.1

Since Apr 8Pushed 1y agoCompare

[ Source](https://github.com/seworqs/commons-string)[ Packagist](https://packagist.org/packages/seworqs/commons-string)[ RSS](/packages/seworqs-commons-string/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (6)Used By (2)

SEworqs Commons String
======================

[](#seworqs-commons-string)

A modern PHP utility library for string manipulation, including case conversion, namespace formatting, path handling, and secure random string generation.

---

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

[](#installation)

Install via Composer:

```
composer require seworqs/commons-string
```

---

Basic Usage
-----------

[](#basic-usage)

```
use Seworqs\Commons\String\Helper\CaseHelper;
use Seworqs\Commons\String\Helper\RandomHelper;
use Seworqs\Commons\String\Helper\PathHelper;
use Seworqs\Commons\String\Helper\NamespaceHelper;

// CaseHelper: Convert strings to different casing styles
$camel  = CaseHelper::from('This is some text')->toCamelCase()->toString();    // thisIsSomeText
$pascal = CaseHelper::from('This is some text')->toPascalCase()->toString();   // ThisIsSomeText

// RandomHelper: Generate random strings
$default = RandomHelper::createRandomString();                                  // 10 chars
$custom  = RandomHelper::createRandomString(12, 'abdef1234567890');             // Safe character set

// PathHelper: Build path-like structures
$path = PathHelper::fromString('src/utilities/logger');
echo $path->toKebabPath(); // src/utilities/logger

// NamespaceHelper: Format segments as a PHP namespace
$ns = NamespaceHelper::fromString('domain/shared/logger_service');
echo $ns->toNamespace(); // Domain\Shared\LoggerService
```

---

More Examples
-------------

[](#more-examples)

- [CaseHelper examples](docs/Examples/CaseHelper.md)
- [RandomHelper examples](docs/Examples/RandomHelper.md)
- [NamespaceHelper examples](docs/Examples/NamespaceHelper.md)
- [PathHelper examples](docs/Examples/PathHelper.md)

---

Features
--------

[](#features)

- Transform strings to common casing styles (camelCase, PascalCase, kebab-case, etc.)
- Support for custom delimiters and method chaining
- Path and namespace formatting
- Generate secure random strings with a custom character set

> See our full [examples overview](docs/Examples.md)

---

Classes and Namespaces
----------------------

[](#classes-and-namespaces)

NamespaceDescriptionSeworqs\\Commons\\String\\Helpers\\CaseHelperConverts strings into various casing styles.Seworqs\\Commons\\String\\Helpers\\PathHelperBuilds and transforms path-like string segments.Seworqs\\Commons\\String\\Helpers\\NamespaceHelperFormats segments as valid PHP namespaces.Seworqs\\Commons\\String\\Helpers\\RandomHelperGenerates secure random strings.---

License
-------

[](#license)

Apache-2.0 — see [LICENSE](./LICENSE)

---

About SEworqs
-------------

[](#about-seworqs)

SEworqs builds clean, reusable modules for PHP and Mendix developers.
Learn more at [github.com/seworqs](https://github.com/seworqs)

---

Badges
------

[](#badges)

[![Latest Version](https://camo.githubusercontent.com/2766487e14c6892c2eae56e2b57130567c44672c489e4c71c4e8938dae2a781a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7365776f7271732f636f6d6d6f6e732d737472696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/seworqs/commons-string)
[![Total Downloads](https://camo.githubusercontent.com/a880e60a57ab92384da09ded9e5acfc3dfd31175c33d091a8197fe00febbec62/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7365776f7271732f636f6d6d6f6e732d737472696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/seworqs/commons-string)
[![License](https://camo.githubusercontent.com/43f6466923a36bf4050b8031441452f8ecdd1d6ec000c6966c2b05fbf8e57427/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7365776f7271732f636f6d6d6f6e732d737472696e673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/seworqs/commons-string)
[![PHP Version](https://camo.githubusercontent.com/dfb6afdb68568ca021a4adc5bb9d06d6144c1cf02c9481571c3a6ed8a152982b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7365776f7271732f636f6d6d6f6e732d737472696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/seworqs/commons-string)
[![Made by SEworqs](https://camo.githubusercontent.com/d261914a774b546f4f5b1e9a121baff37ed64b3909f9f940b655bbc7ad9bb50b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d61646525323062792d5345776f7271732d3030326437343f7374796c653d666c61742d737175617265)](https://github.com/seworqs)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance48

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

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

Total

5

Last Release

384d ago

Major Versions

1.1.0 → 2.0.02025-04-24

### Community

Maintainers

![](https://www.gravatar.com/avatar/4a83a01e1305cbd8007675b4271d06b7d3680f4e9ddc447186632d2c05982cdd?d=identicon)[seworqs](/maintainers/seworqs)

---

Top Contributors

[![seworqs-sefranke](https://avatars.githubusercontent.com/u/205894657?v=4)](https://github.com/seworqs-sefranke "seworqs-sefranke (8 commits)")

---

Tags

case-conversionhelpernamespacepathphprandom-stringseworqsstringutilityrandomphphelperstringutilitypathnamespacesnake casecamelcasecase conversionseworqs

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/seworqs-commons-string/health.svg)

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

###  Alternatives

[clausnz/php-helpers

A Collection of useful php helper functions.

388.7k](/packages/clausnz-php-helpers)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)[sinergi/token

PHP library to generate random strings

188.7k9](/packages/sinergi-token)

PHPackages © 2026

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