PHPackages                             zero-to-prod/psr4-classname - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. zero-to-prod/psr4-classname

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

zero-to-prod/psr4-classname
===========================

Generates a valid PSR-4 Compliant Classname from a string.

v71.1.0(8mo ago)12.1k3MITDockerfilePHP &gt;=7.1CI passing

Since Nov 23Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/zero-to-prod/psr4-classname)[ Packagist](https://packagist.org/packages/zero-to-prod/psr4-classname)[ Docs](https://github.com/zero-to-prod/psr4-classname)[ Fund](https://github.com/sponsors/zero-to-prod)[ RSS](/packages/zero-to-prod-psr4-classname/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (2)Versions (9)Used By (3)

Zerotoprod\\Psr4Classname
=========================

[](#zerotoprodpsr4classname)

[![](art/logo.png)](art/logo.png)

[![Repo](https://camo.githubusercontent.com/9a90a3efeee26aed7d7f2feee9cd84566a26f9c362cc773b184d076210906e1c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6769746875622d677261793f6c6f676f3d676974687562)](https://github.com/zero-to-prod/psr4-classname)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/c0ebe07f665612133ce70e9b3d83b2cdb31585c494be7a1a99acb3ff3011b757/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f707372342d636c6173736e616d652f746573742e796d6c3f6c6162656c3d74657374)](https://github.com/zero-to-prod/psr4-classname/actions)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/062cc72d513af223dc1b8054678b420cd4e3f68a4e40f9ca121ef7799b63791d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f707372342d636c6173736e616d652f6261636b77617264735f636f6d7061746962696c6974792e796d6c3f6c6162656c3d6261636b77617264735f636f6d7061746962696c697479)](https://github.com/zero-to-prod/psr4-classname/actions)[![Packagist Downloads](https://camo.githubusercontent.com/86d61fdedd7b3ef909fe0b1b94b940990d5ebad9163e6ee23a7bf57a4ff5eb36/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a65726f2d746f2d70726f642f707372342d636c6173736e616d653f636f6c6f723d626c7565)](https://packagist.org/packages/zero-to-prod/psr4-classname/stats)[![php](https://camo.githubusercontent.com/456f017e80dcb31ea698e66487fc33e4ac0f648ba846f397a667cbda39771fbd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7a65726f2d746f2d70726f642f707372342d636c6173736e616d652e7376673f636f6c6f723d707572706c65)](https://packagist.org/packages/zero-to-prod/psr4-classname/stats)[![Packagist Version](https://camo.githubusercontent.com/fef13255f046f5d8efeee83bb6a04cb3ac68e3d3ef0f052981eece80f34294e0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a65726f2d746f2d70726f642f707372342d636c6173736e616d653f636f6c6f723d663238643161)](https://packagist.org/packages/zero-to-prod/psr4-classname)[![License](https://camo.githubusercontent.com/40c2400d7c03f00f2fc339434b0c2bdb2d83cc3018e2b38be174fb41a51098c2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7a65726f2d746f2d70726f642f707372342d636c6173736e616d653f636f6c6f723d70696e6b)](https://github.com/zero-to-prod/psr4-classname/blob/main/LICENSE.md)[![wakatime](https://camo.githubusercontent.com/a48f21d20bdca3955cd15772a9dbcfa7d7317b51428321a2ff43b6c07dd4fe89/68747470733a2f2f77616b6174696d652e636f6d2f62616467652f6769746875622f7a65726f2d746f2d70726f642f707372342d636c6173736e616d652e737667)](https://wakatime.com/badge/github/zero-to-prod/psr4-classname)[![Hits-of-Code](https://camo.githubusercontent.com/830c1036e975f1f3dadd6d90c55c152b0b58e3a2f65544d26fa38f8d9e315664/68747470733a2f2f686974736f66636f64652e636f6d2f6769746875622f7a65726f2d746f2d70726f642f707372342d636c6173736e616d653f6272616e63683d6d61696e)](https://hitsofcode.com/github/zero-to-prod/psr4-classname/view?branch=main)

Contents
--------

[](#contents)

- [Introduction](#introduction)
- [Requirements](#requirements)
- [Installation](#installation)
- [Documentation Publishing](#documentation-publishing)
    - [Automatic Documentation Publishing](#automatic-documentation-publishing)
- [Usage](#usage)
- [Local Development](./LOCAL_DEVELOPMENT.md)
- [Contributing](#contributing)

Introduction
------------

[](#introduction)

Generates a valid PSR-4 Compliant Classname from a string.

Requirements
------------

[](#requirements)

- PHP 7.1 or higher.

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

[](#installation)

Install `Zerotoprod\Psr4Classname` via [Composer](https://getcomposer.org/):

```
composer require zero-to-prod/psr4-classname
```

This will add the package to your project's dependencies and create an autoloader entry for it.

Documentation Publishing
------------------------

[](#documentation-publishing)

You can publish this README to your local documentation directory.

This can be useful for providing documentation for AI agents.

This can be done using the included script:

```
# Publish to default location (./docs/zero-to-prod/psr4-classname)
vendor/bin/zero-to-prod-psr4-classname

# Publish to custom directory
vendor/bin/zero-to-prod-psr4-classname /path/to/your/docs
```

### Automatic Documentation Publishing

[](#automatic-documentation-publishing)

You can automatically publish documentation by adding the following to your `composer.json`:

```
{
    "scripts": {
        "post-install-cmd": [
            "zero-to-prod-psr4-classname"
        ],
        "post-update-cmd": [
            "zero-to-prod-psr4-classname"
        ]
    }
}
```

Usage
-----

[](#usage)

```
use Zerotoprod\Psr4Classname\Classname;

Classname::generate('weird%characters*in^name', '.php'); // 'WeirdCharactersInName.php';
```

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

[](#contributing)

Contributions, issues, and feature requests are welcome! Feel free to check the [issues](https://github.com/zero-to-prod/psr4-classname/issues) page if you want to contribute.

1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Commit changes (`git commit -m 'Add some feature'`).
4. Push to the branch (`git push origin feature-branch`).
5. Create a new Pull Request.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance60

Regular maintenance activity

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

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

Recently: every ~58 days

Total

8

Last Release

250d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/502649f05d36c87d494988bd99193a4d908d345335d99c080928a726277371f5?d=identicon)[zero-to-prod](/maintainers/zero-to-prod)

---

Top Contributors

[![zero-to-prod](https://avatars.githubusercontent.com/u/61474950?v=4)](https://github.com/zero-to-prod "zero-to-prod (16 commits)")

---

Tags

phppsr4zero-to-prodpsr4 classname

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zero-to-prod-psr4-classname/health.svg)

```
[![Health](https://phpackages.com/badges/zero-to-prod-psr4-classname/health.svg)](https://phpackages.com/packages/zero-to-prod-psr4-classname)
```

###  Alternatives

[zero-to-prod/data-model

Transforms Data into Type-Safe DTOs.

14226.2k32](/packages/zero-to-prod-data-model)

PHPackages © 2026

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