PHPackages                             ergebnis/classy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. ergebnis/classy

ActiveLibrary[File &amp; Storage](/categories/file-storage)

ergebnis/classy
===============

Provides collectors for classy constructs (classes, enums, interfaces, and traits).

3.0.0(4mo ago)382.8M—2.2%419MITPHPPHP ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0

Since Oct 5Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/ergebnis/classy)[ Packagist](https://packagist.org/packages/ergebnis/classy)[ Docs](https://github.com/ergebnis/classy)[ RSS](/packages/ergebnis-classy/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (18)Versions (30)Used By (19)

classy
======

[](#classy)

[![Integrate](https://github.com/ergebnis/classy/workflows/Integrate/badge.svg)](https://github.com/ergebnis/classy/actions)[![Merge](https://github.com/ergebnis/classy/workflows/Merge/badge.svg)](https://github.com/ergebnis/classy/actions)[![Release](https://github.com/ergebnis/classy/workflows/Release/badge.svg)](https://github.com/ergebnis/classy/actions)[![Renew](https://github.com/ergebnis/classy/workflows/Renew/badge.svg)](https://github.com/ergebnis/classy/actions)

[![Code Coverage](https://camo.githubusercontent.com/350fac20e682b8cb782fe90f367bd11c9fe1ddd3961ae767d16dd94d7d38baea/68747470733a2f2f636f6465636f762e696f2f67682f65726765626e69732f636c617373792f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/ergebnis/classy)

[![Latest Stable Version](https://camo.githubusercontent.com/f7e8464cdfc32a3ff59acb1e1969da55205b22b224512cd5a0c58558029aa0ba/68747470733a2f2f706f7365722e707567782e6f72672f65726765626e69732f636c617373792f762f737461626c65)](https://packagist.org/packages/ergebnis/classy)[![Total Downloads](https://camo.githubusercontent.com/305227facb1c8c6bbb4c6c9522d874969eb5d56a80e6736c51eaed6bb8892cd8/68747470733a2f2f706f7365722e707567782e6f72672f65726765626e69732f636c617373792f646f776e6c6f616473)](https://packagist.org/packages/ergebnis/classy)[![Monthly Downloads](https://camo.githubusercontent.com/c8c4a4c3572ee9179fc4ad810b225cc3fb3b0d80643cb81510a95d91e105a6c6/687474703a2f2f706f7365722e707567782e6f72672f65726765626e69732f636c617373792f642f6d6f6e74686c79)](https://packagist.org/packages/ergebnis/classy)

This project provides a [`composer`](https://getcomposer.org) package with a finder for classy constructs ([classes](https://www.php.net/manual/en/language.oop5.php), [enums](https://www.php.net/manual/en/language.types.enumerations.php), [interfaces](https://www.php.net/manual/en/language.oop5.interfaces.php), and [traits](https://www.php.net/manual/en/language.oop5.traits.php)).

Installation
------------

[](#installation)

Run

```
composer require ergebnis/classy
```

Usage
-----

[](#usage)

This package provides the following collectors for finding classy constructs:

- [`Ergebnis\Classy\Collector\TokenGetAllConstructFromSourceCollector`](#collectortokengetallconstructfromsourcecollector)
- [`Ergebnis\Classy\Collector\PhpTokenTokenizeConstructFromSourceCollector`](#collectorphptokentokenizeconstructfromsourcecollector)
- [`Ergebnis\Classy\Collector\DefaultConstructFromFileCollector`](#collectordefaultconstructfromfilecollector)
- [`Ergebnis\Classy\Collector\DefaultConstructFromSplFileInfoCollector`](#collectordefaultconstructfromsplfileinfocollector)
- [`Ergebnis\Classy\Collector\DefaultConstructFromFinderCollector`](#collectordefaultconstructfromfindercollector)

### `Collector\TokenGetAllConstructFromSourceCollector`

[](#collectortokengetallconstructfromsourcecollector)

Use `Collector\TokenGetAllConstructFromSourceCollector` to collect classy constructs from source code on PHP 7:

```
