Code Duplication    Length = 17-17 lines in 3 locations

src/Traits/ConstMapLikeTrait.php 1 location

@@ 16-32 (lines=17) @@
13
     */
14
    private $container;
15
16
    protected function init($it = null)
17
    {
18
        if (null !== $it) {
19
            $this->validateTraversable($it);
20
21
            $coll = [];
22
            foreach ($it as $key => $value) {
23
                if (is_array($value)) {
24
                    $value = new static($value);
25
                }
26
                $coll[$key] = $value;
27
            }
28
            $this->container = $coll;
29
        } else {
30
            $this->container = [];
31
        }
32
    }
33
34
    /**
35
     * {@inheritdoc}

src/Traits/ConstSetLikeTrait.php 1 location

@@ 16-32 (lines=17) @@
13
     */
14
    private $container;
15
16
    protected function init($it = null)
17
    {
18
        if (null !== $it) {
19
            $this->validateTraversable($it);
20
21
            $coll = [];
22
            foreach ($it as $value) {
23
                if (is_array($value)) {
24
                    $value = new static($value);
25
                }
26
                $coll[] = $value;
27
            }
28
            $this->container = $coll;
29
        } else {
30
            $this->container = [];
31
        }
32
    }
33
34
    /**
35
     * {@inheritdoc}

src/Traits/ConstVectorLikeTrait.php 1 location

@@ 16-32 (lines=17) @@
13
     */
14
    private $container;
15
16
    protected function init($it = null)
17
    {
18
        if (null !== $it) {
19
            $this->validateTraversable($it);
20
21
            $coll = [];
22
            foreach ($it as $value) {
23
                if (is_array($value)) {
24
                    $value = new static($value);
25
                }
26
                $coll[] = $value;
27
            }
28
            $this->container = $coll;
29
        } else {
30
            $this->container = [];
31
        }
32
    }
33
34
    /**
35
     * {@inheritdoc}