Completed
Pull Request — master (#161)
by Alexander
04:42
created

GuzzleTeleporter::__construct()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 2
nc 1
nop 2
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\GuzzleReaderFactory;
15
use Alchemy\Zippy\Resource\ResourceLocator;
16
use Alchemy\Zippy\Resource\ResourceReaderFactory;
17
use Alchemy\Zippy\Resource\Writer\FilesystemWriter;
18
19
/**
20
 * Guzzle Teleporter implementation for HTTP resources
21
 *
22
 * @deprecated Use \Alchemy\Zippy\Resource\GenericTeleporter instead. This class will be removed in v0.5.x
23
 */
24 View Code Duplication
class GuzzleTeleporter 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...
25
{
26
    /**
27
     * @param ResourceReaderFactory $readerFactory
28
     * @param ResourceLocator $resourceLocator
29
     */
30
    public function __construct(ResourceReaderFactory $readerFactory = null, ResourceLocator $resourceLocator = null)
31
    {
32
        parent::__construct($readerFactory ?: new GuzzleReaderFactory(), new FilesystemWriter(), $resourceLocator);
33
    }
34
35
    /**
36
     * Creates the GuzzleTeleporter
37
     *
38
     * @deprecated This method will be removed in v0.5.x
39
     * @return GuzzleTeleporter
40
     */
41
    public static function create()
42
    {
43
        return new static();
0 ignored issues
show
Deprecated Code introduced by
The class Alchemy\Zippy\Resource\Teleporter\GuzzleTeleporter has been deprecated with message: Use \Alchemy\Zippy\Resource\GenericTeleporter instead. This class will be removed in v0.5.x

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
44
    }
45
}
46