PHPackages                             geggleto/setter-strategy - 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. geggleto/setter-strategy

ActiveLibrary

geggleto/setter-strategy
========================

Alternative dispatch strategy for slim 3

0.0.3(10y ago)124MITPHP

Since Mar 4Pushed 10y ago1 watchersCompare

[ Source](https://github.com/geggleto/setter-injection-strategy)[ Packagist](https://packagist.org/packages/geggleto/setter-strategy)[ RSS](/packages/geggleto-setter-strategy/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

[![Build Status](https://camo.githubusercontent.com/fcc0d76200102bc825b3bedabba7ef992e987c39b729129310f9319fafb16e54/68747470733a2f2f7472617669732d63692e6f72672f676567676c65746f2f7365747465722d696e6a656374696f6e2d73747261746567792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/geggleto/setter-injection-strategy)

setter-injection-strategy
=========================

[](#setter-injection-strategy)

This package is intended to replace the default Invocation handler in Slim. This strategy forces controllers to implement `SetterInjectionReceiver` which tells Slim to set the Response, Request, and Arg instead of passing it through the method signature. This saves space on all of your action methods in your controller.

In short it will turn this.

```
class abcController {
  //...
  public function myAction (Request $request, Response $response, $args = []) {
    //..
  }
  //...
}
```

Into This.

```
class abcController implements SetterInjectionReceiver {
  //.. Implement and store the Objects somewhere up here.
  //...
  public function myAction () {
    //..  This is now much more Slim 2 style
  }
  //...
}
```

Or this if you have arguments

```
class abcController implements SetterInjectionReceiver {
  //.. Implement and store the Objects somewhere up here.
  //...
  public function myAction ($arg1, $arg2, $arg3) {
    //..  This is now much more Slim 2 style
  }
  //...
}
```

Install
-------

[](#install)

This package is available via Composer. `composer install geggleto/setter-strategy`

Usage
-----

[](#usage)

There are some configuration changes you will need to make in your Slim application. **If you only wish to use SetterInjection on some of your callables, It will default back to using the RequestResponseArgs style if your controller does not implement the Receiver Interface**

```
// Setup the Strategy in the container by adding a factory method like below.
  $container['foundHandler'] = function ($c) {
      return new SetterInjectionStrategy();
  };
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Every ~2 days

Total

3

Last Release

3714d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f941aecd52e3f8ac94dbe9b714801c7adc767acc32644d3ee6a4efeded84c5e?d=identicon)[geggleto](/maintainers/geggleto)

---

Top Contributors

[![geggleto](https://avatars.githubusercontent.com/u/4027602?v=4)](https://github.com/geggleto "geggleto (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/geggleto-setter-strategy/health.svg)

```
[![Health](https://phpackages.com/badges/geggleto-setter-strategy/health.svg)](https://phpackages.com/packages/geggleto-setter-strategy)
```

###  Alternatives

[phlak/directory-lister

PHP directory lister

2.5k1.4k](/packages/phlak-directory-lister)[oat-sa/tao-core

TAO core extension

66136.7k74](/packages/oat-sa-tao-core)[bacula-web/bacula-web

The open source web based reporting and monitoring tool for Bacula

1537.5k](/packages/bacula-web-bacula-web)[brandembassy/slim-nette-extension

19190.2k](/packages/brandembassy-slim-nette-extension)[docler-labs/codeception-slim-module

Codeception Module for Slim framework.

13178.0k1](/packages/docler-labs-codeception-slim-module)[egroupware/openid

EGroupware OpenID Connect / OAuth2 server

1226.8k2](/packages/egroupware-openid)

PHPackages © 2026

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