Code Duplication    Length = 11-11 lines in 2 locations

src/DecoderPlugin.php 1 location

@@ 42-52 (lines=11) @@
39
     *    @var bool $use_content_encoding Whether this plugin should look at the Content-Encoding header first or only at the Transfer-Encoding (defaults to true).
40
     * }
41
     */
42
    public function __construct(array $config = [])
43
    {
44
        $resolver = new OptionsResolver();
45
        $resolver->setDefaults([
46
            'use_content_encoding' => true,
47
        ]);
48
        $resolver->setAllowedTypes('use_content_encoding', 'bool');
49
        $options = $resolver->resolve($config);
50
51
        $this->useContentEncoding = $options['use_content_encoding'];
52
    }
53
54
    /**
55
     * {@inheritdoc}

src/RetryPlugin.php 1 location

@@ 43-53 (lines=11) @@
40
     *     @var int $retries Number of retries to attempt if an exception occurs before letting the exception bubble up.
41
     * }
42
     */
43
    public function __construct(array $config = [])
44
    {
45
        $resolver = new OptionsResolver();
46
        $resolver->setDefaults([
47
            'retries' => 1,
48
        ]);
49
        $resolver->setAllowedTypes('retries', 'int');
50
        $options = $resolver->resolve($config);
51
52
        $this->retry = $options['retries'];
53
    }
54
55
    /**
56
     * {@inheritdoc}