PHPackages                             ppokatilo/magic-injection-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. ppokatilo/magic-injection-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

ppokatilo/magic-injection-bundle
================================

Magically inject dependencies into services

v1.0.3(11y ago)019MITPHPPHP &gt;=5.3.2

Since Nov 15Pushed 11y ago1 watchersCompare

[ Source](https://github.com/SHyx0rmZ/magic-injection-bundle)[ Packagist](https://packagist.org/packages/ppokatilo/magic-injection-bundle)[ Docs](http://github.com/SHyx0rmZ/magic-injection-bundle)[ RSS](/packages/ppokatilo-magic-injection-bundle/feed)WikiDiscussions master Synced 1mo ago

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

magic-injection-bundle
======================

[](#magic-injection-bundle)

[![Latest Stable Version](https://camo.githubusercontent.com/47052667cf8c2e7f125e854520ef845c2c9184a5694ba2e585cd5a54d0d8c512/687474703a2f2f706f7365722e73657276696365732e776974636865732e696f2f70706f6b6174696c6f2f6d616769632d696e6a656374696f6e2d62756e646c652f762f737461626c652e737667)](https://packagist.org/packages/ppokatilo/magic-injection-bundle)[![Total Downloads](https://camo.githubusercontent.com/19d0a41e27037aac9e73ffa086ae742697f1f6f8baf5533f515fd8d80004a533/687474703a2f2f706f7365722e73657276696365732e776974636865732e696f2f70706f6b6174696c6f2f6d616769632d696e6a656374696f6e2d62756e646c652f646f776e6c6f6164732e737667)](https://packagist.org/packages/ppokatilo/magic-injection-bundle)[![Latest Unstable Version](https://camo.githubusercontent.com/d9c2cfa4fe3c6e17060305516279e17cf3e4a74985fe1204c56e26171711a068/687474703a2f2f706f7365722e73657276696365732e776974636865732e696f2f70706f6b6174696c6f2f6d616769632d696e6a656374696f6e2d62756e646c652f762f756e737461626c652e737667)](https://packagist.org/packages/ppokatilo/magic-injection-bundle)[![License](https://camo.githubusercontent.com/8ef91ae4046fd6f098afe097b118b961ef82a2401e8d26ef439db528b75021c5/687474703a2f2f706f7365722e73657276696365732e776974636865732e696f2f70706f6b6174696c6f2f6d616769632d696e6a656374696f6e2d62756e646c652f6c6963656e73652e737667)](https://packagist.org/packages/ppokatilo/magic-injection-bundle)

This Symfony2 bundle provides a way to magically inject dependencies into your services. The dependencies will **not** be available in the constructor. To use it, you need to complete the following steps:

1. Add the tag `magic_injection.injectable_service` to the service you wish to inject. The tag takes an optional argument called `type`, which you can use to group injectable services.
2. Add the tag `magic_injection.injection_target` to the service which should receive the injected services.
3. Finally, annotate properties with the `MagicInjection` annotation, which will take an optional `type`argument that refers to a group of injectable services.

Example usage
-------------

[](#example-usage)

- services.yml ```
    services:

      service.that.will.be.injected:
        class: Service\MyServiceA
        tags:
          - { name: magic_injection.injectable_service, type: my_services }

      service.that.has.a.dependency:
        class: Service\MyServiceB
        tags:
          - { name: magic_injection.injection_target }
    ```
- MyServiceB.php ```
    class MyServiceB
    {
      /**
       * @MagicInjection(type="my_services")
       * @var \Service\MyServiceA
       */
      private $myServiceA;

      public function __construct()
      {
        assert($this->myServiceA === null);
      }

      public function foo()
      {
        $this->myServiceA->bar();
      }
    }
    ```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

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

Total

4

Last Release

4201d ago

### Community

Maintainers

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

---

Top Contributors

[![SHyx0rmZ](https://avatars.githubusercontent.com/u/654223?v=4)](https://github.com/SHyx0rmZ "SHyx0rmZ (14 commits)")

---

Tags

symfonybundleinjectionservicemagic

### Embed Badge

![Health badge](/badges/ppokatilo-magic-injection-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/ppokatilo-magic-injection-bundle/health.svg)](https://phpackages.com/packages/ppokatilo-magic-injection-bundle)
```

###  Alternatives

[pentatrion/vite-bundle

Vite integration for your Symfony app

2725.3M13](/packages/pentatrion-vite-bundle)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)[pugx/autocompleter-bundle

Add an autocomplete type to forms

93861.6k3](/packages/pugx-autocompleter-bundle)[sineflow/clamav

ClamAV PHP Client for Symfony

10168.5k](/packages/sineflow-clamav)[bornfreee/tactician-domain-events-bundle

Bundle to integrate Tactician Domain Events library with Symfony project

10138.6k](/packages/bornfreee-tactician-domain-events-bundle)

PHPackages © 2026

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