awaitcz / di-attribute
Automatic class registration using a simple attribute for Nette
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/awaitcz/di-attribute
Requires
- nette/di: ^3.2
Requires (Dev)
- orisai/coding-standard: ^3.10
- phpstan/phpstan: ^1.11
- phpstan/phpstan-nette: ^1.3
README
Automatic class registration using a simple attribute for Nette.
Setup
DiAttibute is available on composer:
composer require awaitcz/di-attribute
At first register compiler extension.
extensions: diAttribute: Awaitcz\DiAttribute\DI\DiAttributeExtension
Configuration
diAttribute: # Paths to scan for classes paths: - %appDir%/model # If you need to exclude some namespaces or classes excludes: - App\Model\IgnoreMe
Usage
<?php declare(strict_types=1); namespace App\Model\Awesome; use Awaitcz\DiAttribute\DiService; #[DiService] class AwesomeService { ... }