PHPackages                             darkknightik/nette-injects-extension - 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. darkknightik/nette-injects-extension

ActiveNette-addon

darkknightik/nette-injects-extension
====================================

Nette Framework DI extension for injecting services into other services' properties.

v0.1.0(12y ago)03.5kMITPHPPHP &gt;=5.3.1

Since Dec 12Pushed 10y agoCompare

[ Source](https://github.com/darkknightik/nette-injects-extension)[ Packagist](https://packagist.org/packages/darkknightik/nette-injects-extension)[ RSS](/packages/darkknightik-nette-injects-extension/feed)WikiDiscussions master Synced 1mo ago

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

Service injects for Nette 2.1+
==============================

[](#service-injects-for-nette-21)

Nette Framework DI extension for injecting services into other services' properties.

Motivation
----------

[](#motivation)

Writing constructor/setter injection is sometimes annoyingand while developing, it may eat a lot of time. Also it is simpler to not bother with explicit injection as long as it is not needed (e.g. in small application, not public project etc.).

Requirements
------------

[](#requirements)

- PHP 5.3.1 or newer
- Nette 2.3 or newer

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

[](#installation)

1. Add "`majkl578/nette-injects-extension`" to your dependencies in composer.json. Don't forget to run `composer update`.
2. Register this DI extension as last one in your configuration file in extensions section

    ```
    injects: Majkl578\NetteAddons\Injects\DI\Extension\InjectsExtension

    ```
3. Delete cache.

You're done. ;)

Usage
-----

[](#usage)

All types of instance properties are supported - public, protected as well as private. You can also inject a set of classes of a type, e.g. all implementers of an interface. Also works well with namespaced code and uses.

```
class Foo
{
	/**
	 * @inject
	 * @var Foo
	 */
	public $foo;

	/**
	 * @inject
	 * @var Bar
	 */
	protected $bar;

	/**
	 * @inject
	 * @var Baz
	 */
	private $baz;

	/**
	 * @inject
	 * @var IWatcher[]
	 */
	 protected $watchers;
}
```

Issues
------

[](#issues)

In case of any problems, just leave an issue here on GitHub (or, better, send a pull request).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.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

Unknown

Total

1

Last Release

4540d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5f00b0acff0b3c312a960be72496bbd4ebbb9c582a00fde0219b27db8bb32a4d?d=identicon)[darkknightik](/maintainers/darkknightik)

---

Top Contributors

[![pecinaon](https://avatars.githubusercontent.com/u/716192?v=4)](https://github.com/pecinaon "pecinaon (2 commits)")[![Majkl578](https://avatars.githubusercontent.com/u/144181?v=4)](https://github.com/Majkl578 "Majkl578 (1 commits)")

---

Tags

nettedependency-injectiondiinjectautowire

### Embed Badge

![Health badge](/badges/darkknightik-nette-injects-extension/health.svg)

```
[![Health](https://phpackages.com/badges/darkknightik-nette-injects-extension/health.svg)](https://phpackages.com/packages/darkknightik-nette-injects-extension)
```

###  Alternatives

[php-di/php-di

The dependency injection container for humans

2.8k48.9M994](/packages/php-di-php-di)[nette/di

💎 Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP features.

92340.6M1.4k](/packages/nette-di)[laminas/laminas-servicemanager

Factory-Driven Dependency Injection Container

15955.1M694](/packages/laminas-laminas-servicemanager)[kdyby/autowired

Syntax sugar for working with services in Nette Framework

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

PSR-11 compatible injector. Executes a callable and makes an instances by injecting dependencies from a given DI container.

942.8M38](/packages/yiisoft-injector)[mrclay/props-dic

Props is a simple DI container that allows retrieving values via custom property and method names

3611.7M3](/packages/mrclay-props-dic)

PHPackages © 2026

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