Skip to content

Commit 78ec2b0

Browse files
authored
Merge pull request #10 from moufmouf/filemap
Adding doc for getClassMap
2 parents 6aa872e + 340856f commit 78ec2b0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,14 @@ recursively by passing `false` to the 5th parameter:
4040
```php
4141
$explorer = new GlobClassExplorer('\\This\\Namespace\\Only\\', $psr16Cache, $cacheTtl, null, false);
4242
```
43+
44+
You can also get a class map using the `getClassMap` method.
45+
A class map is an array associating the name of the classes found (in key), to the file they are
46+
linked to (a `SplFileInfo` in value).
47+
48+
```php
49+
$classMap = $explorer->getClassMap();
50+
foreach ($classMap as $class => $fileInfo) {
51+
echo 'Class '.$class.' found in file '.$fileInfo->getPathname();
52+
}
53+
```

0 commit comments

Comments
 (0)