Passed
Push — master ( 610227...7a4f69 )
by Mr
02:59
created

PlainMap::__clone()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

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
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the daikon-cqrs/data-structure project.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Daikon\Tests\DataStructure\Fixture;
10
11
use Daikon\DataStructure\MapInterface;
12
use Daikon\DataStructure\MapTrait;
13
use stdClass;
14
15
final class PlainMap implements MapInterface
16
{
17
    use MapTrait {
0 ignored issues
show
introduced by
The trait Daikon\DataStructure\MapTrait requires some properties which are not provided by Daikon\Tests\DataStructure\Fixture\PlainMap: $compositeVector, $value
Loading history...
18
        __clone as __mapclone;
19
    }
20
21
    private stdClass $testVar;
22
23
    public function __construct(iterable $values = [], stdClass $testVar = null)
24
    {
25
        $this->testVar = $testVar ?? new stdClass;
26
        $this->init($values);
27
    }
28
29
    public function getTestVar(): stdClass
30
    {
31
        return $this->testVar;
32
    }
33
34
    public function __clone()
35
    {
36
        $this->__mapclone();
37
        $this->testVar = clone $this->testVar;
38
    }
39
}
40