PHPackages                             lhcze/fqcn-stripper - 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. lhcze/fqcn-stripper

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

lhcze/fqcn-stripper
===================

Utility for extracting and formatting FQCN base names with string transformation support.

1.0.0(1y ago)1991↓21.4%MITPHPPHP &gt;=8.3CI passing

Since May 26Pushed 1y agoCompare

[ Source](https://github.com/lhcze/fqcn-stripper)[ Packagist](https://packagist.org/packages/lhcze/fqcn-stripper)[ Docs](https://github.com/lhcze/fqcn-stripper)[ RSS](/packages/lhcze-fqcn-stripper/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (1)Dependencies (5)Versions (3)Used By (0)

FQCN Stripper
=============

[](#fqcn-stripper)

FQCN Stripper is a small and flexible PHP 8.3+ utility for extracting and formatting the base class name from a Fully-Qualified Class Name (FQCN).

It supports string transformations like `lowercase`, `UPPERCASE`, and `Ucfirst` — with optional multibyte-safe handling (via `mbstring`).

---

🚀 Features
----------

[](#-features)

- Extracts base class name from a fully-qualified name
- Bitmask modifiers for string formatting:
    - `LOWER` — lowercased
    - `UC` — ucfirst
    - `UPPER` — fully uppercased
    - `LOW_UC` — lower + ucfirst
    - `MULTIBYTE` — applies transformations using `mb_` functions
- Supports both strings and objects
- Caches internally for performance
- Simple API for batch processing

---

🛠️ Requirements
---------------

[](#️-requirements)

- **PHP 8.3+**
- Optional: `mbstring` extension (for `MULTIBYTE`)

---

📦 Installation
--------------

[](#-installation)

```
composer require lhcze/fqcn-stripper
```

✅ Usage
-------

[](#-usage)

```
use Lhcze\FqcnStripper\FqcnStripper;

FqcnStripper::strip('App\\Entity\\User'); // "User"
FqcnStripper::strip('App\\Entity\\User', FqcnStripper::LOWER); // "user"
FqcnStripper::strip('App\\Entity\\User', FqcnStripper::LOW_UC); // "User"
FqcnStripper::strip('App\\Entity\\User', FqcnStripper::UPPER); // "USER"
```

```
FqcnStripper::strip('App\\Entity\\Üser', FqcnStripper::LOW_UC | FqcnStripper::MULTIBYTE); // "Üser"
```

```
$object = new \App\Entity\User();
FqcnStripper::strip($object, FqcnStripper::LOWER); // "user"
```

```
FqcnStripper::strip('App\\WeirdObjects\\UserHandlerDtoEvent', FqcnStripper::TRIM_POSTFIX) // User
```

### 🔁 Batch usage

[](#-batch-usage)

```
$list = [
    'App\\Model\\CustomerModel',
    'App\\Entity\\OrderEntity',
    'App\\Controller\\Admin\\DashboardController',
];

FqcnStripper::stripThemAll($list, FqcnStripper::LOW_UC | FqcnStripper::TRIM_POSTFIX);
// ["Customer", "Order", "Dashboard"]
```

🧪 Code Quality &amp; Local Development
--------------------------------------

[](#-code-quality--local-development)

### Tools &amp; Standards

[](#tools--standards)

CommandStandardsDescription`composer phpunit`N/ARun PHPUnit tests`composer cs`PSR12Check code style (dry-run)`composer cs-fix`PSR12Auto-fix coding standards`composer phpstan`Level 9Run static analysis (PHPStan)`composer check`N/ARuns all checks at onceInstall dependencies and run QA tools:

```
composer install
composer check
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance46

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

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

404d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5402084?v=4)[Lukas](/maintainers/lhcze)[@lhcze](https://github.com/lhcze)

---

Top Contributors

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

---

Tags

phpformatterstringutilityclassnamespacefqcnstripper

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/lhcze-fqcn-stripper/health.svg)

```
[![Health](https://phpackages.com/badges/lhcze-fqcn-stripper/health.svg)](https://phpackages.com/packages/lhcze-fqcn-stripper)
```

###  Alternatives

[coduo/php-to-string

Simple library that converts PHP value into strings

27013.4M14](/packages/coduo-php-to-string)

PHPackages © 2026

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