Random   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 10
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConnection() 0 4 1
1
<?php
2
3
namespace Manticoresearch\Connection\Strategy;
4
5
use Manticoresearch\Connection;
6
7
/**
8
 * Class Random
9
 * @package Manticoresearch\Connection\Strategy
10
 */
11
class Random implements SelectorInterface
12
{
13
    /**
14
     * @param array $connections
15
     * @return Connection
16
     */
17
    public function getConnection(array $connections):Connection
18
    {
19
        shuffle($connections);
20
        return $connections[0];
21
    }
22
}
23