PHPackages                             web6/class-collection - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. web6/class-collection

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

web6/class-collection
=====================

Organize classes in folders and auto/lazy load them as attributes.

06PHP

Since Apr 18Pushed 5y ago1 watchersCompare

[ Source](https://github.com/w6cloud/php-class-collection)[ Packagist](https://packagist.org/packages/web6/class-collection)[ RSS](/packages/web6-class-collection/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

WEB6 PHP Class Collection Trait
===============================

[](#web6-php-class-collection-trait)

Organize classes in folders and auto/lazy load them as attributes.

Install
-------

[](#install)

Install via Composer

```
$ composer require web6/class-collection
```

Usage
-----

[](#usage)

### Configure autoload

[](#configure-autoload)

Configure autoloading by including Composer's generated file :

```
include_once('vendor/autoload.php');
```

### Create member classes

[](#create-member-classes)

Create classes and save them in a folder.

```
class App {

    use \W6\ClassCollection\ClassCollectionTrait;

    public $message = 'Not inited';

    protected function init() {
        $this->message = 'Inited';
    }
}
```

### Use your class

[](#use-your-class)

Anywhere in your application you can request the same instance of the class.

```
$app = App::instance();
echo $app->message;
```

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e97dd2e75248779e468eb3dea9b83ebe935d7effa3ccf00286ed3bae43fac9f9?d=identicon)[w6](/maintainers/w6)

---

Top Contributors

[![w6cloud](https://avatars.githubusercontent.com/u/32245185?v=4)](https://github.com/w6cloud "w6cloud (2 commits)")

### Embed Badge

![Health badge](/badges/web6-class-collection/health.svg)

```
[![Health](https://phpackages.com/badges/web6-class-collection/health.svg)](https://phpackages.com/packages/web6-class-collection)
```

###  Alternatives

[laminas/laminas-eventmanager

Trigger and listen to events within a PHP application

1.0k72.5M255](/packages/laminas-laminas-eventmanager)[cebe/yii2-gravatar

Gravatar Widget for Yii 2

441.9M35](/packages/cebe-yii2-gravatar)[helthe/turbolinks

Helthe Turbolinks Component

112123.0k4](/packages/helthe-turbolinks)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
