LazySet::addAll()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 6
Ratio 100 %

Importance

Changes 0
Metric Value
dl 6
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
/**
4
 * This file is part of the Cubiche package.
5
 *
6
 * Copyright (c) Cubiche
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
namespace Cubiche\Core\Collections\LazyCollection;
12
13
use Cubiche\Core\Collections\SetInterface;
14
use Cubiche\Core\Specification\SpecificationInterface;
15
16
/**
17
 * Lazy Set.
18
 *
19
 * @method SetInterface collection()
20
 *
21
 * @author Ivannis Suárez Jerez <[email protected]>
22
 * @author Karel Osorio Ramírez <[email protected]>
23
 */
24 View Code Duplication
abstract class LazySet extends LazyCollection implements SetInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
25
{
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function add($element)
30
    {
31
        $this->lazyInitialize();
32
33
        $this->collection()->add($element);
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function addAll($elements)
40
    {
41
        $this->lazyInitialize();
42
43
        $this->collection()->addAll($elements);
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49
    public function remove($element)
50
    {
51
        $this->lazyInitialize();
52
53
        return $this->collection()->remove($element);
54
    }
55
56
    /**
57
     * {@inheritdoc}
58
     */
59
    public function removeAll($elements)
60
    {
61
        $this->lazyInitialize();
62
63
        return $this->collection()->removeAll($elements);
64
    }
65
66
    /**
67
     * {@inheritdoc}
68
     */
69
    public function findOne(SpecificationInterface $criteria)
70
    {
71
        $this->lazyInitialize();
72
73
        return $this->collection()->findOne($criteria);
74
    }
75
}
76