PHPackages                             jawitold/fqcn-extractor - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. jawitold/fqcn-extractor

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

jawitold/fqcn-extractor
=======================

A lightweight PHP utility to extract the Fully Qualified Class Name (FQCN) from a PHP source file using the built-in tokenizer.

1.0.3(2mo ago)024MITPHPPHP &gt;=8.1

Since Apr 10Pushed 2mo agoCompare

[ Source](https://github.com/JaWitold/fqcn-extractor)[ Packagist](https://packagist.org/packages/jawitold/fqcn-extractor)[ RSS](/packages/jawitold-fqcn-extractor/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

FQCN Extractor
==============

[](#fqcn-extractor)

A lightweight PHP utility to extract the Fully Qualified Class Name (FQCN) from a PHP source file using the built-in tokenizer.

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

[](#installation)

```
composer require jawitold/fqcn-extractor
```

Usage
-----

[](#usage)

```
use JaWitold\FqcnExtractor\FqcnExtractor;

$extractor = new FqcnExtractor();
$fqcn = $extractor->extract('path/to/file.php');

// Returns something like: My\Namespace\MyClass
echo $fqcn;
```

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

[](#requirements)

- PHP 8.1+
- PHP `tokenizer` extension (built-in by default)

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENCE.md](LICENCE.md) file for details.

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance87

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

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

Total

3

Last Release

63d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9f1b988f57767688751592b78c64abb618d7339ab4a9e060c32b5d40c8e6d694?d=identicon)[JaWitold](/maintainers/JaWitold)

---

Top Contributors

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

---

Tags

phptokenizernamespaceextractorfqcnclass-name

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jawitold-fqcn-extractor/health.svg)

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

###  Alternatives

[rajentrivedi/tokenizer-x

TokenizerX calculates required tokens for given prompt

91242.5k3](/packages/rajentrivedi-tokenizer-x)[nikic/phlexy

Lexing experiments in PHP

162589.7k14](/packages/nikic-phlexy)[corveda/php-sandbox

A PHP library that can be used to run PHP code in a sandboxed environment

23790.9k2](/packages/corveda-php-sandbox)[mathematicator-core/tokenizer

Math Tokenizer

104.9k6](/packages/mathematicator-core-tokenizer)[bupy7/xml-constructor

The array-like constructor of XML document structure.

1338.9k](/packages/bupy7-xml-constructor)

PHPackages © 2026

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