Completed
Push — master ( c0eda5...1ea1f4 )
by Sergey
03:04
created

CommandsPool   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A clear() 0 3 1
A shift() 0 3 1
A add() 0 3 1
1
<?php
2
3
namespace seregazhuk\React\Memcached\Connection;
4
5
class CommandsPool
6
{
7
    /**
8
     * @var string[]
9
     */
10
    protected $commands = [];
11
12
    /**
13
     * @param string $command
14
     */
15
    public function add($command)
16
    {
17
        $this->commands[] = $command;
18
    }
19
20
    public function clear()
21
    {
22
        $this->commands = [];
23
    }
24
25
    /**
26
     * @return string
27
     */
28
    public function shift()
29
    {
30
        return array_shift($this->commands);
31
    }
32
}
33