PHPackages                             palmero/withforks - 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. palmero/withforks

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

palmero/withforks
=================

Make your own container classes

v1.0.0(7y ago)0332MITPHP

Since Dec 27Pushed 7y ago1 watchersCompare

[ Source](https://github.com/lucaspalmero/withforks)[ Packagist](https://packagist.org/packages/palmero/withforks)[ RSS](/packages/palmero-withforks/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (2)Used By (0)

Withforks
=========

[](#withforks)

A PSR-11 class-inheriting implementation

Example
=======

[](#example)

```
use Palmero\Withforks;

class Container extends Withforks {

	protected function getSomeClass() {
		return new SomeClass(
			$this->getSettings()['someClass']
		);
	}

	protected function getSomeOtherClass() {
		return new SomeOtherClass(
			$this->getSettings()['someOtherClass']
		);
	}

}

```

To instantiate the container, just pass it an associative array with the configs required for each method:

```
$container = new Container([
	'someClass' => [
		'config' => true
	],
	'someOtherClass' => [
		'config' => "something"
	],
]);

```

You can access everything...:

- The PSR-11 way: `$container->has('someClass')` and `$container->get('someClass')`
- The Withforks way: `$container->someClass`

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

2742d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16234510?v=4)[Lucas Palmero](/maintainers/lucaspalmero)[@lucaspalmero](https://github.com/lucaspalmero)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/palmero-withforks/health.svg)

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

###  Alternatives

[symfony/dependency-injection

Allows you to standardize and centralize the way objects are constructed in your application

4.2k447.1M9.1k](/packages/symfony-dependency-injection)[illuminate/contracts

The Illuminate Contracts package.

706127.7M12.7k](/packages/illuminate-contracts)[illuminate/container

The Illuminate Container package.

31180.7M2.3k](/packages/illuminate-container)[symfony/type-info

Extracts PHP types information.

20062.9M225](/packages/symfony-type-info)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

562565.8k42](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751284.3k37](/packages/civicrm-civicrm-core)

PHPackages © 2026

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