Completed
Push — master ( 01c7e6...383742 )
by Thibaud
02:54
created

LegacyGuzzleTeleporter::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of Zippy.
5
 *
6
 * (c) Alchemy <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Alchemy\Zippy\Resource\Teleporter;
13
14
use Alchemy\Zippy\Resource\Reader\Guzzle\LegacyGuzzleReaderFactory;
15
use Alchemy\Zippy\Resource\ResourceLocator;
16
use Alchemy\Zippy\Resource\ResourceReaderFactory;
17
use Alchemy\Zippy\Resource\Writer\FilesystemWriter;
18
use Guzzle\Http\Client;
19
20
/**
21
 * Guzzle Teleporter implementation for HTTP resources
22
 */
23 View Code Duplication
class LegacyGuzzleTeleporter extends GenericTeleporter
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
24
{
25
    /**
26
     * @param Client $client
27
     * @param ResourceReaderFactory $readerFactory
28
     * @param ResourceLocator $resourceLocator
29
     */
30
    public function __construct(
31
        Client $client = null,
32
        ResourceReaderFactory $readerFactory = null,
33
        ResourceLocator $resourceLocator = null
34
    ) {
35
        parent::__construct($readerFactory ?: new LegacyGuzzleReaderFactory($client), new FilesystemWriter(),
36
            $resourceLocator);
37
    }
38
39
    /**
40
     * Creates the GuzzleTeleporter
41
     *
42
     * @deprecated
43
     * @return LegacyGuzzleTeleporter
44
     */
45
    public static function create()
46
    {
47
        return new static();
48
    }
49
}
50