Code Duplication    Length = 11-11 lines in 2 locations

src/Mouf/Database/TDBM/AlterableResultIterator.php 2 locations

@@ 73-83 (lines=11) @@
70
     *
71
     * @param $object
72
     */
73
    public function add($object)
74
    {
75
        $this->alterations->attach($object, 'add');
76
77
        if ($this->resultArray !== null) {
78
            $foundKey = array_search($object, $this->resultArray, true);
79
            if ($foundKey === false) {
80
                $this->resultArray[] = $object;
81
            }
82
        }
83
    }
84
85
    /**
86
     * Removes an object from the result set.
@@ 90-100 (lines=11) @@
87
     *
88
     * @param $object
89
     */
90
    public function remove($object)
91
    {
92
        $this->alterations->attach($object, 'delete');
93
94
        if ($this->resultArray !== null) {
95
            $foundKey = array_search($object, $this->resultArray, true);
96
            if ($foundKey !== false) {
97
                unset($this->resultArray[$foundKey]);
98
            }
99
        }
100
    }
101
102
    /**
103
     * Casts the result set to a PHP array.