@@ -157,12 +157,12 @@ use Api\App\Helper\PaginationHelper;
157
157
use Api\Book\Collection\BookCollection;
158
158
use Api\Book\Entity\Book;
159
159
use Doctrine\ORM\EntityRepository;
160
- use Dot\AnnotatedServices\Annotation \Entity;
160
+ use Dot\DependencyInjection\Attribute \Entity;
161
161
162
162
/**
163
- * @Entity(name="Api\Book\Entity\Book")
164
163
* @extends EntityRepository<object >
165
164
*/
165
+ #[Entity(name: Book::class)]
166
166
class BookRepository extends EntityRepository
167
167
{
168
168
public function saveBook(Book $book): Book
@@ -204,16 +204,12 @@ namespace Api\Book\Service;
204
204
205
205
use Api\Book\Entity\Book;
206
206
use Api\Book\Repository\BookRepository;
207
- use Dot\AnnotatedServices\Annotation \Inject;
207
+ use Dot\DependencyInjection\Attribute \Inject;
208
208
use DateTimeImmutable;
209
209
210
210
class BookService implements BookServiceInterface
211
211
{
212
- /**
213
- * @Inject({
214
- * BookRepository::class,
215
- * })
216
- */
212
+ #[Inject(BookRepository::class)]
217
213
public function __construct(protected BookRepository $bookRepository)
218
214
{
219
215
}
@@ -265,8 +261,8 @@ use Api\Book\Handler\BookHandler;
265
261
use Api\Book\Repository\BookRepository;
266
262
use Api\Book\Service\BookService;
267
263
use Api\Book\Service\BookServiceInterface;
268
- use Dot\AnnotatedServices \Factory\AnnotatedRepositoryFactory ;
269
- use Dot\AnnotatedServices \Factory\AnnotatedServiceFactory ;
264
+ use Dot\DependencyInjection \Factory\AttributedRepositoryFactory ;
265
+ use Dot\DependencyInjection \Factory\AttributedServiceFactory ;
270
266
use Mezzio\Hal\Metadata\MetadataMap;
271
267
use Api\App\ConfigProvider as AppConfigProvider;
272
268
@@ -284,9 +280,9 @@ class ConfigProvider
284
280
{
285
281
return [
286
282
'factories' => [
287
- BookHandler::class => AnnotatedServiceFactory ::class,
288
- BookService::class => AnnotatedServiceFactory ::class,
289
- BookRepository::class => AnnotatedRepositoryFactory ::class,
283
+ BookHandler::class => AttributedServiceFactory ::class,
284
+ BookService::class => AttributedServiceFactory ::class,
285
+ BookRepository::class => AttributedRepositoryFactory ::class,
290
286
],
291
287
'aliases' => [
292
288
BookServiceInterface::class => BookService::class,
@@ -487,19 +483,17 @@ use Mezzio\Hal\ResourceGenerator;
487
483
use Psr\Http\Message\ResponseInterface;
488
484
use Psr\Http\Message\ServerRequestInterface;
489
485
use Psr\Http\Server\RequestHandlerInterface;
490
- use Dot\AnnotatedServices\Annotation \Inject;
486
+ use Dot\DependencyInjection\Attribute \Inject;
491
487
492
488
class BookHandler implements RequestHandlerInterface
493
489
{
494
- use ResponseTrait;
495
-
496
- /**
497
- * @Inject({
498
- * HalResponseFactory::class,
499
- * ResourceGenerator::class,
500
- * BookServiceInterface::class
501
- * })
502
- */
490
+ use HandlerTrait;
491
+
492
+ #[Inject(
493
+ HalResponseFactory::class,
494
+ ResourceGenerator::class,
495
+ BookServiceInterface::class
496
+ )]
503
497
public function __construct(
504
498
protected HalResponseFactory $responseFactory,
505
499
protected ResourceGenerator $resourceGenerator,
0 commit comments