From 340856f91960ebe1df266e350678060b13a8eaa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Fri, 10 Jan 2020 23:32:26 +0100 Subject: [PATCH] Adding doc for getClassMap --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 8001800..da483a3 100644 --- a/README.md +++ b/README.md @@ -40,3 +40,14 @@ recursively by passing `false` to the 5th parameter: ```php $explorer = new GlobClassExplorer('\\This\\Namespace\\Only\\', $psr16Cache, $cacheTtl, null, false); ``` + +You can also get a class map using the `getClassMap` method. +A class map is an array associating the name of the classes found (in key), to the file they are +linked to (a `SplFileInfo` in value). + +```php +$classMap = $explorer->getClassMap(); +foreach ($classMap as $class => $fileInfo) { + echo 'Class '.$class.' found in file '.$fileInfo->getPathname(); +} +```