Code Duplication    Length = 9-9 lines in 3 locations

src/AbstractEnumSet.php 1 location

@@ 145-153 (lines=9) @@
142
     * If no valid iterator position in found the iterator position will be 0.
143
     * @return void
144
     */
145
    public function rewind()
146
    {
147
        if (trim($this->bitset, "\0") !== '') {
148
            $this->ordinal = -1;
149
            $this->next();
150
        } else {
151
            $this->ordinal = 0;
152
        }
153
    }
154
155
    /**
156
     * Test if the iterator in a valid state

src/BinaryEnumSet.php 1 location

@@ 127-135 (lines=9) @@
124
     * If no valid iterator position in found the iterator position will be 0.
125
     * @return void
126
     */
127
    public function rewind()
128
    {
129
        if (trim($this->bitset, "\0") !== '') {
130
            $this->ordinal = -1;
131
            $this->next();
132
        } else {
133
            $this->ordinal = 0;
134
        }
135
    }
136
137
    /**
138
     * Test if the iterator in a valid state

src/EnumSet.php 1 location

@@ 201-209 (lines=9) @@
198
     * @see rewind
199
     * @see doRewindInt
200
     */
201
    private function doRewindBin()
202
    {
203
        if (trim($this->bitset, "\0") !== '') {
204
            $this->ordinal = -1;
205
            $this->next();
206
        } else {
207
            $this->ordinal = 0;
208
        }
209
    }
210
211
    /**
212
     * Go to the first valid iterator position.