PHPackages                             aviator/delegate - 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. aviator/delegate

ActiveLibrary

aviator/delegate
================

1.0(8y ago)13.1k↑288.2%1MITPHPPHP &gt;=7.0.0

Since Oct 11Pushed 8y ago1 watchersCompare

[ Source](https://github.com/danielsdeboer/delegate)[ Packagist](https://packagist.org/packages/aviator/delegate)[ RSS](/packages/aviator-delegate/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (1)

[![Build Status](https://camo.githubusercontent.com/ced0332792f94f5bad7c33f5cfa5a3e9674ba2975a0fcd7b26d6b5ba75efe23f/68747470733a2f2f7472617669732d63692e6f72672f64616e69656c736465626f65722f64656c65676174652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/danielsdeboer/delegate)

Overview
--------

[](#overview)

Delegate is a simple way to make property calls chainable when they otherwise wouldn't be.

### Installation

[](#installation)

Via Composer:

```
composer require aviator/delegate

```

### Testing

[](#testing)

Via Composer:

```
composer test

```

### Usage

[](#usage)

Use a magic `__get` to set up a delegate:

```
public function __get ($name)
{
    if ($name === 'foo') {
        return $this->getFooDelegate()
    }
}
```

which will return the delegate when `$instance->foo` is called.

Since Delegate accepts anything as its first parameter and a Closure as its second, you can do anything:

```
private function getFooDelegate ()
{
    return new Delegate($this->someMember, function ($collection, $name) {
        return $collection->get($name);
    }
}
```

This allows you to call `$instance->foo->bar`, which will call your function against `someMember`.

###  Health Score

30

—

LowBetter than 67% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3086d ago

### Community

Maintainers

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

---

Top Contributors

[![danielsdeboer](https://avatars.githubusercontent.com/u/13170241?v=4)](https://github.com/danielsdeboer "danielsdeboer (3 commits)")

---

Tags

phpphp7

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aviator-delegate/health.svg)

```
[![Health](https://phpackages.com/badges/aviator-delegate/health.svg)](https://phpackages.com/packages/aviator-delegate)
```

PHPackages © 2026

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