Passed
Push — master ( 8d8060...3598fa )
by Pol
12:31 queued 05:18
created

WopiConfiguration   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 32
ccs 0
cts 12
cp 0
rs 10
c 1
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A offsetUnset() 0 3 1
A offsetGet() 0 3 1
A offsetExists() 0 3 1
A jsonSerialize() 0 3 1
A offsetSet() 0 3 1
1
<?php
2
3
/**
4
 * For the full copyright and license information, please view
5
 * the LICENSE file that was distributed with this source code.
6
 */
7
8
declare(strict_types=1);
9
10
namespace ChampsLibres\WopiLib\Configuration;
11
12
use function array_key_exists;
13
14
final class WopiConfiguration implements WopiConfigurationInterface
15
{
16
    private array $properties;
17
18
    public function __construct(array $properties)
19
    {
20
        $this->properties = $properties;
21
    }
22
23
    public function jsonSerialize(): array
24
    {
25
        return $this->properties;
26
    }
27
28
    public function offsetExists($offset)
29
    {
30
        return array_key_exists($offset, $this->properties);
31
    }
32
33
    public function offsetGet($offset)
34
    {
35
        return $this->properties[$offset];
36
    }
37
38
    public function offsetSet($offset, $value)
39
    {
40
        $this->properties[$offset] = $value;
41
    }
42
43
    public function offsetUnset($offset)
44
    {
45
        unset($this->properties[$offset]);
46
    }
47
}
48