awaitcz / di-attribute
There is no license information available for the latest version (1.1) of this package.
Automatic class registration using a simple attribute for Nette
1.1
2024-09-25 19:49 UTC
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 { ... }