LegacyGuzzleTeleporter::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 7
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 1
nop 3
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of Compressy.
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 Gocobachi\Compressy\Resource\Teleporter;
13
14
use Gocobachi\Compressy\Resource\Reader\Guzzle\LegacyGuzzleReaderFactory;
15
use Gocobachi\Compressy\Resource\ResourceLocator;
16
use Gocobachi\Compressy\Resource\ResourceReaderFactory;
17
use Gocobachi\Compressy\Resource\Writer\FilesystemWriter;
18
use Guzzle\Http\Client;
0 ignored issues
show
Bug introduced by
The type Guzzle\Http\Client was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
19
20
/**
21
 * Guzzle Teleporter implementation for HTTP resources
22
 *
23
 * @deprecated Use \Alchemy\Compressy\Resource\GenericTeleporter instead. This class will be removed in v0.5.x
24
 */
25
class LegacyGuzzleTeleporter extends GenericTeleporter
26
{
27
    /**
28
     * @param Client $client
29
     * @param ResourceReaderFactory $readerFactory
30
     * @param ResourceLocator $resourceLocator
31
     */
32
    public function __construct(
33
        Client $client = null,
34
        ResourceReaderFactory $readerFactory = null,
35
        ResourceLocator $resourceLocator = null
36
    ) {
37
        parent::__construct($readerFactory ?: new LegacyGuzzleReaderFactory($client), new FilesystemWriter(),
38
            $resourceLocator);
39
    }
40
41
    /**
42
     * Creates the GuzzleTeleporter
43
     *
44
     * @deprecated
45
     * @return LegacyGuzzleTeleporter
46
     */
47
    public static function create()
48
    {
49
        return new static();
50
    }
51
}
52