services:
  logger.cslog:
    class: Drupal\content_sync\Logger\ContentSyncLog
    arguments: ['@database', '@logger.log_message_parser']
    tags:
      - { name: logger }
      - { name: backend_overridable }
  content_sync.snaphoshot:
    class: Drupal\content_sync\Form\ContentExportForm
    arguments: ['@entity_type.manager','@content_sync.exporter','@content_sync.manager','@file_system']
  content.storage.staging:
    class: Drupal\Core\Config\FileStorage
    factory: Drupal\content_sync\Content\ContentFileStorageFactory::getSync
  content.storage.sync:
    alias: content.storage.staging
  content.storage:
    class: Drupal\Core\Config\CachedStorage
    arguments: ['@content.storage.active', '@cache.content']
  content.storage.active:
    class: Drupal\Core\Config\DatabaseStorage
    arguments: ['@database', 'cs_db_snapshot']
    public: false
    tags:
      - { name: backend_overridable }
  cache.content:
    class: Drupal\Core\Cache\CacheBackendInterface
    tags:
      - { name: cache.bin, default_backend: cache.backend.chainedfast }
    factory: cache_factory:get
    arguments: [content]
 # content_sync.content_subscriber:
 #   class: Drupal\content_sync\EventSubscriber\ContentSyncEvents
 #   tags:
 #     - { name: event_subscriber }
  content_sync.help_manager:
      class: Drupal\content_sync\ContentSyncHelpManager
      arguments: ['@current_user', '@config.factory', '@module_handler', '@state', '@path.matcher']
  content_sync.exporter:
      class: Drupal\content_sync\Exporter\ContentExporter
      arguments: ['@serializer']
  content_sync.importer:
      class: Drupal\content_sync\Importer\ContentImporter
      arguments: ['@serializer', '@entity_type.manager']
  content_sync.manager:
      class: Drupal\content_sync\ContentSyncManager
      arguments: ['@serializer', '@entity_type.manager','@content_sync.exporter', '@content_sync.importer']
  content_sync.normalizer.content_entity:
    class: Drupal\content_sync\Normalizer\ContentEntityNormalizer
    arguments: ['@entity_type.manager', '@entity_type.repository', '@entity_field.manager', '@entity_type.bundle.info', '@entity.repository', '@plugin.manager.sync_normalizer_decorator']
    tags:
      - { name: normalizer, priority: 6 }
  content_sync.normalizer.file_entity:
    class: Drupal\content_sync\Normalizer\FileEntityNormalizer
    arguments: ['@entity_type.manager', '@entity_type.repository', '@entity_field.manager', '@entity_type.bundle.info', '@entity.repository', '@plugin.manager.sync_normalizer_decorator', '@file_system']
    tags:
      - { name: normalizer, priority: 7 }
  content_sync.normalizer.user_entity:
    class: Drupal\content_sync\Normalizer\UserEntityNormalizer
    arguments: ['@entity_type.manager', '@entity_type.repository', '@entity_field.manager', '@entity_type.bundle.info', '@entity.repository', '@plugin.manager.sync_normalizer_decorator']
    tags:
      - { name: normalizer, priority: 7 }
  content_sync.normalizer.text_item:
    class: Drupal\content_sync\Normalizer\TextItemNormalizer
    tags:
      - { name: normalizer, priority: 10 }
  content_sync.normalizer.image_item:
    class: Drupal\content_sync\Normalizer\ImageItemNormalizer
    tags:
      - { name: normalizer, priority: 9 }
    arguments: ['@entity.repository']
  plugin.manager.sync_normalizer_decorator:
    class: Drupal\content_sync\Plugin\SyncNormalizerDecoratorManager
    parent: default_plugin_manager
  yaml_serialization.encoder.yaml:
    class: Drupal\content_sync\Encoder\YamlEncoder
    arguments: ["@serialization.yaml"]
    tags:
      - { name: encoder, format: yaml }
  content_sync.normalizer.entity_reference_field_item:
    class: Drupal\content_sync\Normalizer\EntityReferenceFieldItemNormalizer
    tags:
      # Set the priority lower than the hal entity reference field item
      # normalizer, so that we do not replace that for hal_json but higher than
      # this modules generic field item normalizer.
      # @todo Find a better way for this in https://www.drupal.org/node/2575761.
      - { name: normalizer, priority: 9 }
    arguments: ['@entity.repository']
