PHPackages                             autoframe/interface-to-concrete - 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. [Framework](/categories/framework)
4. /
5. autoframe/interface-to-concrete

ActiveLibrary[Framework](/categories/framework)

autoframe/interface-to-concrete
===============================

PHP Interface to concrete class mapper Autoframe Framework

3.0.0(2y ago)0171BSD-3-ClausePHPPHP ^7.4 || ^8.0

Since May 31Pushed 2y ago1 watchersCompare

[ Source](https://github.com/autoframe/interface-to-concrete)[ Packagist](https://packagist.org/packages/autoframe/interface-to-concrete)[ Docs](https://github.com/autoframe)[ RSS](/packages/autoframe-interface-to-concrete/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (6)Versions (5)Used By (0)

Autoframe is a low level framework that is oriented on SOLID flexibility
========================================================================

[](#autoframe-is-a-low-level-framework-that-is-oriented-on-solid-flexibility)

[![Build Status](https://github.com/autoframe/interface-to-concrete/workflows/PHPUnit-tests/badge.svg?branch=main)](https://github.com/autoframe/interface-to-concrete/actions?query=branch:main)[![License: The 3-Clause BSD License](https://camo.githubusercontent.com/7a6078e948a5440e7dd15b68e0ce27ee99e433523a46f3fc274e65e5499e4c06/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6175746f6672616d652f696e746572666163652d746f2d636f6e6372657465)](https://opensource.org/license/bsd-3-clause/)[![Packagist Version](https://camo.githubusercontent.com/d402864bd377c9b89f1ab9d52a3b67e92fbe5666ca3546e320afb45cc483c05d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6175746f6672616d652f696e746572666163652d746f2d636f6e63726574653f6c6162656c3d7061636b6167697374253230737461626c65)](https://camo.githubusercontent.com/d402864bd377c9b89f1ab9d52a3b67e92fbe5666ca3546e320afb45cc483c05d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6175746f6672616d652f696e746572666163652d746f2d636f6e63726574653f6c6162656c3d7061636b6167697374253230737461626c65)[![Downloads](https://camo.githubusercontent.com/50a4f5779338c8adfbffdbed5891651a5584eebcb953b116f81cc0ff8b3a09ee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6175746f6672616d652f696e746572666163652d746f2d636f6e63726574652e737667)](https://packagist.org/packages/autoframe/interface-to-concrete)

*PHP Interface to concrete class mapper, composer vendor path, Autoframe Framework*

Namespace:

- Autoframe\\InterfaceToConcrete

Classes:

- class AfrInterfaceToConcreteClass implements AfrInterfaceToConcreteInterface
    - configurator and caller for AfrMultiClassMapper
- class AfrMultiClassMapper
    - magic
- class AfrVendorPath
    - will detect the vendor dir and read the psr4, psr0 and class-maps

---

AfrInterfaceToConcreteClass
===========================

[](#afrinterfacetoconcreteclass)

```
	$oAfrConfigWiredPaths = new AfrInterfaceToConcreteClass(
	  $sEnv, //'DEV'/ 'PRODUCTION'/ 'STAGING'/ 'DEBUG'
	  $aEnvSettings [], //overwrite profile settings
	  $aExtraPaths = [] //all compose paths are covered
	  );
	$oAfrConfigWiredPaths->getClassInterfaceToConcrete();
	//OR STATIC CALL AFTER INSTANTIATING:
	AfrInterfaceToConcreteClass::$oInstance->getClassInterfaceToConcrete();
```

---

AfrToConcreteStrategiesClass
============================

[](#afrtoconcretestrategiesclass)

```
    $sRuleName = 'CustomRule';
    $obj = \Autoframe\InterfaceToConcrete\AfrToConcreteStrategiesClass::getLatestInstance();
    //add a custom strategy
    $sCustomStrategy = 'customStrategy';
    $obj->addStrategy($sCustomStrategy, function (
        AfrToConcreteStrategiesInterface $oStrategiesInterface,
        array                            $aMap
    ) {
        //$aMap = ['ns1\\concreteInstantiable' => true, 'ns2\\concreteSingleton' => 2];
        if ($oStrategiesInterface->getNotConcreteFQCN() === 'extendClosureFn') {
            //match something
            if (isset($aMap['concreteSingleton'])) unset($aMap['concreteSingleton']);
        } else {
            $aMap = [];
        }
        return $aMap;
    });
    //set some custom rules
    $obj->addPriorityRules($sRuleName, [
        $sCustomStrategy, //custom
        AfrToConcreteStrategiesClass::StrategyClosureFn, //multiple
        AfrToConcreteStrategiesClass::StrategyContextBound, //single
        AfrToConcreteStrategiesClass::StrategyContextNamespaceFilterArr, //multiple
        AfrToConcreteStrategiesClass::StrategyContextHttpRequestUriRegex, //multiple
        AfrToConcreteStrategiesClass::StrategyGetDeclaredClasses, //multiple
        AfrToConcreteStrategiesClass::StrategyOtherNamespaceThanNotInstantiable, //multiple
        AfrToConcreteStrategiesClass::StrategyProjectComposerPsrNamespaces, //multiple
        AfrToConcreteStrategiesClass::StrategyFirstFoundWithWarning,  //single
        //    AfrToConcreteStrategiesClass::StrategyFirstFoundWithoutWarning,  //single
        //    AfrToConcreteStrategiesClass::StrategyShuffle,  //single
        //    AfrToConcreteStrategiesClass::StrategyFail,  //empty
    ])->setPriorityRule($sRuleName);

    $aMap = ['ns1\\concreteInstantiable' => true, 'ns2\\concreteSingleton' => 2];
    $sResplvedClass = $obj->resolveMap(
        $aMap,
        'ns\\notConcrete',
        $bCache = false
    );

    // OR
    $sResplvedClass = $obj->resolveInterfaceToConcrete(
        'ns\\notConcrete',
         $oAfrInterfaceToConcreteInterface, // \Autoframe\InterfaceToConcrete\AfrInterfaceToConcreteInterface
    $bCache = false
    );
    $sResplvedClass = '1|ns1\\concreteInstantiable'; // new ns1\\concreteInstantiable(...);
    $sResplvedClass = '2|ns2\\concreteSingleton'; //singleton::getInstance();
    $sResplvedClass = '0|ns\\notConcrete'; //fail
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.7% 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 ~5 days

Total

4

Last Release

1059d ago

Major Versions

1.0.2 → 2.0.02023-06-09

2.0.0 → 3.0.02023-06-17

### Community

Maintainers

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

---

Top Contributors

[![autoframe](https://avatars.githubusercontent.com/u/34517931?v=4)](https://github.com/autoframe "autoframe (18 commits)")[![niladam](https://avatars.githubusercontent.com/u/4151765?v=4)](https://github.com/niladam "niladam (1 commits)")

---

Tags

composerinterfacepathmapmapperautoautowirewireconcreteautoframe

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/autoframe-interface-to-concrete/health.svg)

```
[![Health](https://phpackages.com/badges/autoframe-interface-to-concrete/health.svg)](https://phpackages.com/packages/autoframe-interface-to-concrete)
```

###  Alternatives

[graham-campbell/manager

Manager Provides Some Manager Functionality For Laravel

39221.1M134](/packages/graham-campbell-manager)[yiisoft/yii2-composer

The composer plugin for Yii extension installer

8828.8M55](/packages/yiisoft-yii2-composer)[concrete5/concrete5

Concrete – an open source content management system.

8302.5k2](/packages/concrete5-concrete5)[kdyby/autowired

Syntax sugar for working with services in Nette Framework

30885.7k9](/packages/kdyby-autowired)[yiisoft/config

Composer plugin and a library for config assembling

34368.9k27](/packages/yiisoft-config)[yiisoft/access

An interface for checking access

31289.6k3](/packages/yiisoft-access)

PHPackages © 2026

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