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.

Maintainers

Package info

github.com/JaWitold/fqcn-extractor

pkg:composer/jawitold/fqcn-extractor

Statistics

Installs: 19

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.3 2026-04-28 10:19 UTC

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 tokenizer extension (built-in by default)

License

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