StringCollection   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 6
c 1
b 0
f 0
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A push() 0 4 1
A fetch() 0 5 2
1
<?php
2
3
namespace Carpenstar\ByBitAPI\Core\Objects\Collection;
4
5
class StringCollection extends AbstractCollection
6
{
7
    /**
8
     * @param string|null $item
9
     * @return $this
10
     */
11
    public function push(?string $item = null): self
12
    {
13
        $this->collection[0] = $item;
14
        return $this;
15
    }
16
17
    /**
18
     * @return string
19
     */
20
    public function fetch(): ?string
21
    {
22
        $item = current($this->collection);
23
        next($this->collection);
24
        return is_bool($item) ? null : $item;
25
    }
26
}
27