Completed
Push — master ( 944a1d...98f153 )
by Oleg
01:36
created

SimpleBag::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 2
cp 0
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace SlayerBirden\DataFlow\Data;
5
6
use SlayerBirden\DataFlow\DataBagInterface;
7
8
class SimpleBag extends \ArrayObject implements DataBagInterface
9
{
10
    /**
11
     * @inheritdoc
12
     */
13 3
    public function jsonSerialize()
14
    {
15 3
        return $this->getArrayCopy();
16
    }
17
18
    /**
19
     * @inheritdoc
20
     */
21 5
    public function toArray(): array
22
    {
23 5
        return $this->getArrayCopy();
24
    }
25
26
    /**
27
     * Return string representation of the bag.
28
     *
29
     * @return string
30
     */
31
    public function __toString(): string
32
    {
33
        return json_encode($this);
34
    }
35
}
36