StaticArrayLocator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A locate() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the Veslo project <https://github.com/symfony-doge/veslo>.
5
 *
6
 * (C) 2019 Pavel Petrov <[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
 * @license https://opensource.org/licenses/GPL-3.0 GPL-3.0
12
 */
13
14
declare(strict_types=1);
15
16
namespace Veslo\AppBundle\Http\Proxy\Locator;
17
18
use Veslo\AppBundle\Http\Proxy\LocatorInterface;
19
20
/**
21
 * Uses a simple array node from parameters file to provide proxy list
22
 */
23
final class StaticArrayLocator implements LocatorInterface
24
{
25
    /**
26
     * Array of available proxies for requests, IP:PORT
27
     *
28
     * @var string[]
29
     */
30
    private $proxyList;
31
32
    /**
33
     * StaticArrayLocator constructor.
34
     *
35
     * @param string[] $proxyList Array of available proxies for requests, IP:PORT
36
     */
37
    public function __construct(array $proxyList)
38
    {
39
        $this->proxyList = $proxyList;
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function locate(): iterable
46
    {
47
        return $this->proxyList;
48
    }
49
}
50