Parse the FQCN from a PHP file containing a class, an interface, a trait or an enum (requires PHP >= 8.1).
- Requires at least PHP 8.0
The recommended way to install fqcn-parser is through Composer:
$ composer require wol-soft/fqcn-parser
$fqcn = FQCNParser::getFQCNFromFile(__DIR__ . '/MyClass.php');