PHPackages                             monkeyscloud/monkeyslegion-contracts - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. monkeyscloud/monkeyslegion-contracts

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

monkeyscloud/monkeyslegion-contracts
====================================

Lightweight contracts (interfaces &amp; abstract bases) for the MonkeysLegion framework — zero framework coupling.

v2.0.0(1mo ago)0141↓77.8%1MITPHPPHP ^8.4

Since Apr 22Pushed 1mo agoCompare

[ Source](https://github.com/MonkeysCloud/MonkeysLegion-Contracts)[ Packagist](https://packagist.org/packages/monkeyscloud/monkeyslegion-contracts)[ Docs](https://github.com/MonkeysCloud/MonkeysLegion-Contracts)[ RSS](/packages/monkeyscloud-monkeyslegion-contracts/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (2)Versions (2)Used By (1)

MonkeysLegion Contracts
=======================

[](#monkeyslegion-contracts)

[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)

Lightweight contracts (interfaces &amp; abstract base classes) for the **MonkeysLegion** framework.

This package exists so that **external packages and third-party bundles** can implement framework contracts (like `ServiceProviderInterface`) **without** pulling in the entire `monkeyscloud/monkeyslegion` meta-package.

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

[](#installation)

```
composer require monkeyscloud/monkeyslegion-contracts
```

Dependencies
------------

[](#dependencies)

PackageVersion`php``^8.4``psr/container``^2.0`**That's it.** No framework packages required.

Provided Contracts
------------------

[](#provided-contracts)

### `ServiceProviderInterface`

[](#serviceproviderinterface)

The contract for modular service providers. Implement this to register DI definitions, specify context (`http`, `cli`, `all`), and hook into the container boot lifecycle.

```
use MonkeysLegion\Contracts\ServiceProviderInterface;
use Psr\Container\ContainerInterface;

class MyPackageProvider implements ServiceProviderInterface
{
    public function getDefinitions(): array
    {
        return [
            MyService::class => fn() => new MyService(),
        ];
    }

    public function provides(): array
    {
        return [MyService::class];
    }

    public function context(): string
    {
        return 'all';
    }

    public function isDeferred(): bool
    {
        return false;
    }

    public function boot(ContainerInterface $container): void
    {
        // Post-build initialization
    }
}
```

### `AbstractServiceProvider`

[](#abstractserviceprovider)

Convenience base class with sensible defaults — only `getDefinitions()` is required:

```
use MonkeysLegion\Contracts\AbstractServiceProvider;

class MyPackageProvider extends AbstractServiceProvider
{
    public function getDefinitions(): array
    {
        return [
            MyService::class => fn() => new MyService(),
        ];
    }
}
```

How It Fits Together
--------------------

[](#how-it-fits-together)

LayerPackageWhat it does**Contract**`monkeyslegion-contracts`Defines `ServiceProviderInterface`**Framework**`monkeyslegion`Discovers &amp; boots providers via `ProviderScanner`**Your Package**`your-vendor/your-package`Implements the interface, requires only `contracts`**App**`monkeyslegion-skeleton`Registers package providers in BootstrapExternal packages require only `monkeyslegion-contracts`. The consuming application registers them during bootstrap:

```
Application::create($basePath)
    ->withProviders([YourPackageProvider::class])
    ->run();
```

License
-------

[](#license)

MIT © [MonkeysCloud](https://monkeys.cloud)

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance90

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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

49d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2913369?v=4)[Jorge Peraza](/maintainers/yorchperaza)[@yorchperaza](https://github.com/yorchperaza)

---

Top Contributors

[![yorchperaza](https://avatars.githubusercontent.com/u/2913369?v=4)](https://github.com/yorchperaza "yorchperaza (1 commits)")

---

Tags

interfacescontractsdiservice providermonkeyslegion

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/monkeyscloud-monkeyslegion-contracts/health.svg)

```
[![Health](https://phpackages.com/badges/monkeyscloud-monkeyslegion-contracts/health.svg)](https://phpackages.com/packages/monkeyscloud-monkeyslegion-contracts)
```

###  Alternatives

[symfony/contracts

A set of abstractions extracted out of the Symfony components

3.9k65.5M127](/packages/symfony-contracts)[symfony/translation-contracts

Generic abstractions related to translation

2.6k730.8M596](/packages/symfony-translation-contracts)[symfony/cache-contracts

Generic abstractions related to caching

2.4k324.3M286](/packages/symfony-cache-contracts)[symfony/http-client-contracts

Generic abstractions related to HTTP clients

2.0k419.3M382](/packages/symfony-http-client-contracts)[league/container

A fast and intuitive dependency injection container.

86792.2M396](/packages/league-container)[laminas/laminas-servicemanager

Factory-Driven Dependency Injection Container

15857.5M779](/packages/laminas-laminas-servicemanager)

PHPackages © 2026

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