parameters:
    guzzle.client.class: GuzzleHttp\Client
    guzzle.handler_stack.class: GuzzleHttp\HandlerStack
    guzzle.formatter.class: GuzzleHttp\MessageFormatter

    emoe_guzzle.request_profiler_middlware.class: Emoe\GuzzleBundle\Middleware\RequestProfilerMiddleware
    emoe_guzzle.request_logger_middlware.class: Emoe\GuzzleBundle\Middleware\RequestLoggerMiddleware
    emoe_guzzle.log_adapter.class: Emoe\GuzzleBundle\Log\ArrayLogAdapter
    emoe_guzzle.data_collector.class: Emoe\GuzzleBundle\DataCollector\GuzzleDataCollector
    emoe_guzzle.stopwatch.class: Symfony\Component\Stopwatch\Stopwatch
    emoe_guzzle.request.format: "{request}"
    emoe_guzzle.response.format: "{response}"

services:
    emoe_guzzle.handler_stack:
        class: %guzzle.handler_stack.class%
        public: false
        factory: [%guzzle.handler_stack.class%, create]

    emoe_guzzle.request_profiler_middleware:
        class: %emoe_guzzle.request_profiler_middlware.class%
        public: false
        arguments:
            - @debug.stopwatch

    emoe_guzzle.request_logger_middleware:
        class: %emoe_guzzle.request_logger_middlware.class%
        public: false
        arguments:
            - @emoe_guzzle.log_adapter
            - @emoe_guzzle.stopwatch
            - @emoe_guzzle.message_formatter

    emoe_guzzle.stopwatch:
        class: %emoe_guzzle.stopwatch.class%
        public: false

    emoe_guzzle.log_adapter:
        class: %emoe_guzzle.log_adapter.class%
        public: false

    emoe_guzzle.message_formatter:
        class: %guzzle.formatter.class%
        public: false

    emoe_guzzle.request_formatter:
        class: %guzzle.formatter.class%
        public: false
        arguments:
            - %emoe_guzzle.request.format%

    emoe_guzzle.response_formatter:
        class: %guzzle.formatter.class%
        public: false
        arguments:
            - %emoe_guzzle.response.format%

    emoe_guzzle.data_collector:
        class: %emoe_guzzle.data_collector.class%
        public: false
        arguments:
            - @emoe_guzzle.log_adapter
            - @emoe_guzzle.request_formatter
            - @emoe_guzzle.response_formatter
        tags:
            - { name: data_collector, template: "EmoeGuzzleBundle:Collector:guzzle", id: "guzzle" }

    guzzle.client:
        class: %guzzle.client.class%
        tags:
            - { name: guzzle.client }
