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

WopiConfiguration::offsetExists()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 1
b 0
f 0
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