PHPackages                             nayjest/str-case-converter - 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. nayjest/str-case-converter

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

nayjest/str-case-converter
==========================

Library for converting strings from camel case to snake case and vice versa.

v1.0.0(10y ago)12484.6k↓12.2%[2 issues](https://github.com/Nayjest/StrCaseConverter/issues)14MITPHPPHP &gt;=5

Since Jun 4Pushed 2y ago2 watchersCompare

[ Source](https://github.com/Nayjest/StrCaseConverter)[ Packagist](https://packagist.org/packages/nayjest/str-case-converter)[ RSS](/packages/nayjest-str-case-converter/feed)WikiDiscussions master Synced 1mo ago

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

nayjest/str-case-converter
==========================

[](#nayjeststr-case-converter)

[![Latest Stable Version](https://camo.githubusercontent.com/99f410d8da2aab478ccaeead0f7cb91023bbef790270157fd0fc119a2c88e117/68747470733a2f2f706f7365722e707567782e6f72672f6e61796a6573742f7374722d636173652d636f6e7665727465722f762f737461626c652e737667)](https://packagist.org/packages/nayjest/str-case-converter)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b1a05f0cbc0747b2a8dc0250e0ce68f231ea9f97347563b31a2923488a64a5e7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4e61796a6573742f53747243617365436f6e7665727465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Nayjest/StrCaseConverter/?branch=master)[![Build Status](https://camo.githubusercontent.com/179d118d319e8daff72965d7f1ce755d0ea4d4c5f46423140cf1b0a9832e7f71/68747470733a2f2f7472617669732d63692e6f72672f4e61796a6573742f53747243617365436f6e7665727465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Nayjest/StrCaseConverter)[![Code Coverage](https://camo.githubusercontent.com/a9a359f4b8be24dcdc7fd03d60e49b90248590b820115c73d96669ddb856b786/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4e61796a6573742f53747243617365436f6e7665727465722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Nayjest/StrCaseConverter/?branch=master)

Library for converting strings from camel case to snake case and vice versa.

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

[](#installation)

The recommended way of installing the library is through [Composer](https://getcomposer.org).

Run following command:

```
composer require nayjest/str-case-converter
```

Usage
-----

[](#usage)

### Converting from snake case to camel case

[](#converting-from-snake-case-to-camel-case)

```
use Nayjest\StrCaseConverter\Str;
...
echo Str::toCamelCase('my-string'); // 'MyString'
echo Str::toCamelCase('one_more_string'); // 'OneMoreString'
```

Source string may be separated to words using following characters: '-', '\_' and space.

### Converting from camel case to snake case

[](#converting-from-camel-case-to-snake-case)

```
use Nayjest\StrCaseConverter\Str;
...
echo Str::toSnakeCase('MyString'); // 'my_string'

// It's possible to use custom delimiter:
echo Str::toSnakeCase('OneMoreString', '-'); // 'one-more-string'
```

Testing
-------

[](#testing)

Run following command:

```
phpunit
```

License
-------

[](#license)

© 2015—2023 Vitalii Stepanenko

Licensed under the MIT License.

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

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 96.3% 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

4002d ago

### Community

Maintainers

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

---

Top Contributors

[![Nayjest](https://avatars.githubusercontent.com/u/153999?v=4)](https://github.com/Nayjest "Nayjest (26 commits)")[![bobdenotter](https://avatars.githubusercontent.com/u/1833361?v=4)](https://github.com/bobdenotter "bobdenotter (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nayjest-str-case-converter/health.svg)

```
[![Health](https://phpackages.com/badges/nayjest-str-case-converter/health.svg)](https://phpackages.com/packages/nayjest-str-case-converter)
```

###  Alternatives

[zschuessler/laravel-route-to-class

A Laravel view composer that will convert the current route to a body class. 'admin/product/5/edit' becomes 'admin-product-edit'

26428.8k1](/packages/zschuessler-laravel-route-to-class)[mrm-commerce/magento-coding-standard-phpcs

MRM Commerce PHP Code Sniffer Coding Standard designed for Magento 2 applications

4751.2k](/packages/mrm-commerce-magento-coding-standard-phpcs)[helis/settings-manager-bundle

Provides a nice way to define variables and inject them into application parts

3069.1k](/packages/helis-settings-manager-bundle)[stepanenko3/nova-settings

This Laravel Nova settings tool based on env, using nativ nova fields and resources

3219.8k](/packages/stepanenko3-nova-settings)[vaimo/module-admin-auto-login

Provides automatic admin login on Magento projects; Useful addition when working with a project locally (should be used only as require-dev)

2140.1k](/packages/vaimo-module-admin-auto-login)[koala-framework/sourcemaps

Sourcemaps Utities

1563.5k2](/packages/koala-framework-sourcemaps)

PHPackages © 2026

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