PHPackages                             netsells/interface-binder - 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. netsells/interface-binder

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

netsells/interface-binder
=========================

A simple package that allows you to bind interfaces to concrete classes using PHP8 attributes

1.0.1(5y ago)1898MITPHPPHP ^8.0

Since Feb 9Pushed 3y ago2 watchersCompare

[ Source](https://github.com/netsells/interface-binder)[ Packagist](https://packagist.org/packages/netsells/interface-binder)[ RSS](/packages/netsells-interface-binder/feed)WikiDiscussions master Synced 1mo ago

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

Interface Binder
================

[](#interface-binder)

Interface binder provides an easy way to bind interfaces to implementations within a given array of directories.

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

[](#installation)

using composer:

```
composer require netsells/interface-binder
```

Then publish the config file using the following artisan command:

```
php artisan vendor:publish --tag=interface-binder
```

Usage
-----

[](#usage)

Add the directories you want to scan for interfaces to the `directories` array in the `interface-binder.php` config file:

```
return [
    /*
    |--------------------------------------------------------------------------
    | Directories to scan for interfaces
    |--------------------------------------------------------------------------
    |
    */

    'directories' => [
        app_path('Features'),
        app_path('Services'),
    ],
];
```

Then all you need to do is give the interface you whish to bind a `BoundTo` attribute to tell the `Binder` which concrete class you wish to bind it to:

```
namespace App\Features\CodeVerifier;

use App\Models\User;

#[BoundTo(UserCodeVerifier::class)]
interface UserCodeVerifierInterface
{
    public function verifyUserCode(User $user, string $codeGiven): bool;
}
```

Which is implemented by the following concrete class:

```
namespace App\Features\CodeVerifier;

use App\Models\User;

class UserCodeVerifier implements UserCodeVerifierInterface
{
    public function verifyUserCode(User $user, string $codeGiven): bool
    {
        return true;
    }
}
```

And that's it! When you attempt to resolve `UserCodeVerifierInterface` out of the container you'll get an instance of `UserCodeVerifier`.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity60

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

Every ~0 days

Total

2

Last Release

1921d ago

### Community

Maintainers

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

---

Tags

interfaceattributesbinder

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/netsells-interface-binder/health.svg)

```
[![Health](https://phpackages.com/badges/netsells-interface-binder/health.svg)](https://phpackages.com/packages/netsells-interface-binder)
```

###  Alternatives

[nette/robot-loader

🍀 Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.

89152.7M321](/packages/nette-robot-loader)[jetbrains/phpstorm-attributes

PhpStorm specific attributes

41416.0M647](/packages/jetbrains-phpstorm-attributes)[samrap/acf-fluent

A fluent interface for the Advanced Custom Fields WordPress plugin

28656.0k4](/packages/samrap-acf-fluent)[spiral/attributes

PHP attributes reader

233.6M45](/packages/spiral-attributes)[spatie/php-attribute-reader

A clean API for working with PHP attributes

80216.4k11](/packages/spatie-php-attribute-reader)[psalm/attributes

A collection of PHP 8 Attributes that Psalm can understand

19120.0k2](/packages/psalm-attributes)

PHPackages © 2026

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