Auto-configure services and repositories

Enable the auto-configuration of service and repository classes,
including support for classes in subdirectories by using
`getRelativePathname()` rather than `getFilename()` and making some
additional changes to the result.

References #347
This commit is contained in:
Oliver Davies 2021-01-13 23:10:38 +00:00
parent f6791516c5
commit 53ab326415
9 changed files with 183 additions and 26 deletions

View file

@ -1,24 +1,25 @@
parameters:
container.autowiring.strict_mode: true
services:
Drupal\Core\Config\ConfigFactoryInterface:
alias: config.factory
Drupal\Core\Entity\EntityTypeManagerInterface:
alias: entity_type.manager
Drupal\Core\Queue\QueueFactory:
alias: queue
Drupal\opdavies_blog\EventSubscriber\PushPostToSocialMediaOnceItIsPublished:
autowire: true
tags:
- { name: event_subscriber }
Drupal\opdavies_blog\EventSubscriber\SortTagsAlphabeticallyWhenPostIsSaved:
autowire: true
tags:
- { name: event_subscriber }
Drupal\opdavies_blog\Repository\PostRepository:
autowire: true
Drupal\opdavies_blog\Service\PostPusher\IftttPostPusher:
autowire: true
Drupal\opdavies_blog\Service\PostPusher\NullPostPusher:
autowire: true
Drupal\opdavies_blog\Service\PostPusher\PostPusher:
alias: Drupal\opdavies_blog\Service\PostPusher\IftttPostPusher
Drupal\opdavies_blog\Repository\RelatedPostsRepository:
autowire: true
GuzzleHttp\ClientInterface:
alias: http_client