PHPackages                             majkl578/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. [Framework](/categories/framework)
4. /
5. majkl578/nette-injects-extension

AbandonedArchivedNette-addon[Framework](/categories/framework)

majkl578/nette-injects-extension
================================

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

v0.1.0(12y ago)4621[5 issues](https://github.com/Majkl578/nette-injects-extension/issues)MITPHPPHP &gt;=5.3.1

Since Dec 12Pushed 12y ago2 watchersCompare

[ Source](https://github.com/Majkl578/nette-injects-extension)[ Packagist](https://packagist.org/packages/majkl578/nette-injects-extension)[ RSS](/packages/majkl578-nette-injects-extension/feed)WikiDiscussions master Synced 2mo 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.1 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

20

—

LowBetter than 14% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

4535d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/56faa1d197f67a98564f3bfb84d39aeeaaa7e1c979c804378b07aad783b13100?d=identicon)[Majkl578](/maintainers/Majkl578)

---

Top Contributors

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

---

Tags

nettedependency-injectiondiinjectautowire

### Embed Badge

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

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

###  Alternatives

[nette/di

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

92140.6M1.4k](/packages/nette-di)[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)[mouf/mouf

The Mouf PHP framework: an open-source PHP framework providing an easy way to download, install, use and reuse components, with a graphical user interface.

55146.0k17](/packages/mouf-mouf)[mouf/pimple-interop

This project is a very simple extension to the Pimple microframework. It adds to Pimple compatibility with the container-interop APIs.

102.4M2](/packages/mouf-pimple-interop)[joomla/di

Joomla DI Package

15391.2k11](/packages/joomla-di)

PHPackages © 2026

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