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
2026-04-28 10:19 UTC
Requires
- php: >=8.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.94
- phpstan/phpstan: ^2.1
This package is auto-updated.
Last update: 2026-04-28 10:20:21 UTC
README
A lightweight PHP utility to extract the Fully Qualified Class Name (FQCN) from a PHP source file using the built-in tokenizer.
Installation
composer require jawitold/fqcn-extractor
Usage
use JaWitold\FqcnExtractor\FqcnExtractor; $extractor = new FqcnExtractor(); $fqcn = $extractor->extract('path/to/file.php'); // Returns something like: My\Namespace\MyClass echo $fqcn;
Requirements
- PHP 8.1+
- PHP
tokenizerextension (built-in by default)
License
This project is licensed under the MIT License - see the LICENCE.md file for details.