File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111[ ![ Latest Stable Version] ( https://poser.pugx.org/ergebnis/classy/v/stable )] ( https://packagist.org/packages/ergebnis/classy )
1212[ ![ Total Downloads] ( https://poser.pugx.org/ergebnis/classy/downloads )] ( https://packagist.org/packages/ergebnis/classy )
1313
14- Provides a finder for classy constructs (classes, interfaces, and traits).
14+ Provides a finder for classy constructs (classes, enums, interfaces, and traits).
1515
1616## Installation
1717
@@ -40,19 +40,20 @@ namespace Example;
4040
4141class Foo {}
4242
43- interface Bar {}
43+ enum Bar {}
4444
45- trait Baz {}
45+ interface Baz {}
46+
47+ trait Qux {}
4648PHP;
4749
48- /** @var Construct[] $constructs */
4950$constructs = Constructs::fromSource($source);
5051
5152$names = array_map(static function (Construct $construct): string {
5253 return $construct->name();
5354}, $constructs);
5455
55- var_dump($names); // ['Example\Bar', 'Example\Baz', 'Example\Foo']
56+ var_dump($names); // ['Example\Bar', 'Example\Baz', 'Example\Foo', 'Example\Qux' ]
5657```
5758
5859### Collect classy constructs from a directory
@@ -65,7 +66,6 @@ Use `Constructs::fromDirectory()` to collect classy constructs in a directory:
6566use Ergebnis\Classy\Construct;
6667use Ergebnis\Classy\Constructs;
6768
68- /** @var Construct[] $constructs */
6969$constructs = Constructs::fromDirectory(__DIR__ . '/example');
7070
7171$names = array_map(static function (Construct $construct): string {
You can’t perform that action at this time.
0 commit comments