PHPackages                             kassko/class-resolver-bundle - 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. kassko/class-resolver-bundle

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

kassko/class-resolver-bundle
============================

Integrate the class-resolver component to Symfony

v1.0.3(4y ago)025.4k↓50%1PHPPHP &gt;=5.5.0

Since Sep 14Pushed 4y ago1 watchersCompare

[ Source](https://github.com/kassko/class-resolver-bundle)[ Packagist](https://packagist.org/packages/kassko/class-resolver-bundle)[ RSS](/packages/kassko-class-resolver-bundle/feed)WikiDiscussions 1.0 Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (25)Used By (1)

class-resolver-bundle
=====================

[](#class-resolver-bundle)

[![Build Status](https://camo.githubusercontent.com/7904712aefa61fc77fd450e54512dea54ac82d69cf3fd893bd50640450e77a43/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6b6173736b6f2f636c6173732d7265736f6c7665722d62756e646c652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/kassko/class-resolver-bundle)[![Latest Stable Version](https://camo.githubusercontent.com/9e89a01e6f637799e72554fc2ea58dd6ebdb4229d3a3418640f02379fbe94c8e/68747470733a2f2f706f7365722e707567782e6f72672f6b6173736b6f2f636c6173732d7265736f6c7665722d62756e646c652f762f737461626c652e706e67)](https://packagist.org/packages/kassko/class-resolver-bundle)[![Total Downloads](https://camo.githubusercontent.com/64023453c939929bd9ab5b4c354d300a4cc78354121db83e9542a5b9cbdbc490/68747470733a2f2f706f7365722e707567782e6f72672f6b6173736b6f2f636c6173732d7265736f6c7665722d62756e646c652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/kassko/class-resolver-bundle)[![Latest Unstable Version](https://camo.githubusercontent.com/c6199586243f1d971dc9a74937d91bed0deccf6036315cf835955a785396d49b/68747470733a2f2f706f7365722e707567782e6f72672f6b6173736b6f2f636c6173732d7265736f6c7665722d62756e646c652f762f756e737461626c652e706e67)](https://packagist.org/packages/kassko/class-resolver-bundle)

Bundle which integrates [`class-resolver`](https://github.com/kassko/class-resolver) into Symfony. Please for natives features, take a look at the [`class-resolver documentation`](https://github.com/kassko/class-resolver/blob/master/README.md).

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

[](#installation)

You can install this component with composer `composer require kassko/class-resolver-bundle:some_version`

You also need to register the bundle to your kernel:

```
public function registerBundles()
{
    $bundles = array(
        new Kassko\Bundle\ClassResolverBundle\KasskoClassResolverBundle(),
    );
}
```

There are two differents ways to use the class-resolver
-------------------------------------------------------

[](#there-are-two-differents-ways-to-use-the-class-resolver)

### Example of semantic configuration

[](#example-of-semantic-configuration)

```
kassko_class_resolver:
    container_adapter_class: Kassko\Bundle\ClassResolverBundle\Adapter\Container\SymfonyContainerAdapter # default
    resolver_aliases:
    	alias_one: my_container_resolver_service_one
    	# - {alias_one: my_container_resolver_service_one}
    resolvers:
        container:
            [my_container_resolver_service_one, my_container_resolver_service_two]
            # or
            # - { resolver_service: my_container_resolver_service_one, resolver_aliases: [alias_two] }
            # - { resolver_service: my_container_resolver_service_two }
        map:
            map_one:
                resolver_service: my_map_resolver_service_one
                items:
                    "My\\Namespace": my_service_one
                    "My\\Namespace\\Two": my_service_two
                    # or
                    # - { class: "My\\Namespace", service: my_service_one }
                    # - { class: "My\\Namespace\\Two", service: my_service_two }
        factory_adapter:
            - resolver_service: my_factory_adapter_resolver_service_one
              adapted_service: my_adapted_service_one
              support_method: supports
              resolve_method: resolve
            - resolver_service: my_factory_adapter_resolver_service_two
              adapted_service: my_adapted_service_two
              support_method: supports
              resolve_method: resolve
            # or with the following syntax
            - {resolver_service: adapter_one, adapted_factory: resolver_one} # etc
        static_factory_adapter:
            - resolver_service: my_static_factory_adapter_resolver_service_one
              adapted_class: my_static_resolver_class
              support_method: supports
              resolve_method: resolve
            - resolver_service: my_static_factory_adapter_resolver_service_two
              adapted_class: my_static_resolver_class
              support_method: supports
              resolve_method: resolve
            # or with the following syntax
            - {resolver_service: adapter_two, adapted_factory: resolver_two} # etc
```

### You can define some class resolvers in semantic configuration and use them in you service configuration file

[](#you-can-define-some-class-resolvers-in-semantic-configuration-and-use-them-in-you-service-configuration-file)

```

```

### You can both define some class resolvers on the fly and feed them with pairs \[class, service\] all from your service configuration file

[](#you-can-both-define-some-class-resolvers-on-the-fly-and-feed-them-with-pairs-class-service-all-from-your-service-configuration-file)

You register your service like pairs \[class, service\] to a resolver you create on the fly:

```

```

And you inject the good resolver (identified by it's group) in the concerned services:

```

```

A group is a way not to manipulate some service.

This way to do has the advantage to add some new resolvers without changing the semantic configuration and to use work with only one file (the service configuration file).

For more information about this last feature, please read the [more detailed documentation](src/Resources/doc/fr/documentation_fr.md)

### Finally, you can use some class resolvers defined on the semantic configuration and feed them from your service configuration file

[](#finally-you-can-use-some-class-resolvers-defined-on-the-semantic-configuration-and-feed-them-from-your-service-configuration-file)

You register your service like a pair \[class, service\] in the already existing resolver `my_container_resolver_service_one`:

```

```

You inject the resolver `my_container_resolver_service_one` in a service which need it:

```

```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity68

Established project with proven stability

 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 ~137 days

Recently: every ~19 days

Total

21

Last Release

1510d ago

Major Versions

v0.3.3.0 → v1.0.02021-12-03

v0.3.3.1 → v1.0.22022-03-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/9fac4367e85288a508e3720645e35b3cbe119b93e06b2d8a382b0a375413a561?d=identicon)[kassko](/maintainers/kassko)

---

Top Contributors

[![kassko](https://avatars.githubusercontent.com/u/8608325?v=4)](https://github.com/kassko "kassko (48 commits)")

---

Tags

factorydependencyinjectionclassresolver

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kassko-class-resolver-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/kassko-class-resolver-bundle/health.svg)](https://phpackages.com/packages/kassko-class-resolver-bundle)
```

###  Alternatives

[composer/composer

Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.

29.4k187.2M2.6k](/packages/composer-composer)[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k295.3M2.5k](/packages/symfony-property-access)[php-di/invoker

Generic and extensible callable invoker

26857.8M56](/packages/php-di-invoker)[nette/robot-loader

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

89352.7M321](/packages/nette-robot-loader)[bamarni/composer-bin-plugin

No conflicts for your bin dependencies

52722.0M859](/packages/bamarni-composer-bin-plugin)[rybakit/arguments-resolver

ArgumentsResolver allows you to determine the arguments to pass to a function or method.

26107.7k7](/packages/rybakit-arguments-resolver)

PHPackages © 2026

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