@@ -118,196 +118,140 @@ public function getOffset() : int
118118 return $ this ->offset ;
119119 }
120120
121- public static function eqIterator ( ) : self
121+ public static function iteratorType ( int $ iteratorType ) : self
122122 {
123123 $ self = new self ();
124- $ self ->iteratorType = IteratorTypes:: EQ ;
124+ $ self ->iteratorType = $ iteratorType ;
125125
126126 return $ self ;
127127 }
128128
129- public function andEqIterator ( ) : self
129+ public function andIteratorType ( int $ iteratorType ) : self
130130 {
131131 $ new = clone $ this ;
132- $ new ->iteratorType = IteratorTypes:: EQ ;
132+ $ new ->iteratorType = $ iteratorType ;
133133
134134 return $ new ;
135135 }
136136
137- public static function reqIterator () : self
137+ public static function eqIterator () : self
138138 {
139- $ self = new self ( );
140- $ self -> iteratorType = IteratorTypes:: REQ ;
139+ return self :: iteratorType (IteratorTypes:: EQ );
140+ }
141141
142- return $ self ;
142+ public function andEqIterator () : self
143+ {
144+ return $ this ->andIteratorType (IteratorTypes::EQ );
143145 }
144146
145- public function andReqIterator () : self
147+ public static function reqIterator () : self
146148 {
147- $ new = clone $ this ;
148- $ new -> iteratorType = IteratorTypes:: REQ ;
149+ return self :: iteratorType (IteratorTypes:: REQ ) ;
150+ }
149151
150- return $ new ;
152+ public function andReqIterator () : self
153+ {
154+ return $ this ->andIteratorType (IteratorTypes::REQ );
151155 }
152156
153157 public static function allIterator () : self
154158 {
155- $ self = new self ();
156- $ self ->iteratorType = IteratorTypes::ALL ;
157-
158- return $ self ;
159+ return self ::iteratorType (IteratorTypes::ALL );
159160 }
160161
161162 public function andAllIterator () : self
162163 {
163- $ new = clone $ this ;
164- $ new ->iteratorType = IteratorTypes::ALL ;
165-
166- return $ new ;
164+ return $ this ->andIteratorType (IteratorTypes::ALL );
167165 }
168166
169167 public static function ltIterator () : self
170168 {
171- $ self = new self ();
172- $ self ->iteratorType = IteratorTypes::LT ;
173-
174- return $ self ;
169+ return self ::iteratorType (IteratorTypes::LT );
175170 }
176171
177172 public function andLtIterator () : self
178173 {
179- $ new = clone $ this ;
180- $ new ->iteratorType = IteratorTypes::LT ;
181-
182- return $ new ;
174+ return $ this ->andIteratorType (IteratorTypes::LT );
183175 }
184176
185177 public static function leIterator () : self
186178 {
187- $ self = new self ();
188- $ self ->iteratorType = IteratorTypes::LE ;
189-
190- return $ self ;
179+ return self ::iteratorType (IteratorTypes::LE );
191180 }
192181
193182 public function andLeIterator () : self
194183 {
195- $ new = clone $ this ;
196- $ new ->iteratorType = IteratorTypes::LE ;
197-
198- return $ new ;
184+ return $ this ->andIteratorType (IteratorTypes::LE );
199185 }
200186
201187 public static function geIterator () : self
202188 {
203- $ self = new self ();
204- $ self ->iteratorType = IteratorTypes::GE ;
205-
206- return $ self ;
189+ return self ::iteratorType (IteratorTypes::GE );
207190 }
208191
209192 public function andGeIterator () : self
210193 {
211- $ new = clone $ this ;
212- $ new ->iteratorType = IteratorTypes::GE ;
213-
214- return $ new ;
194+ return $ this ->andIteratorType (IteratorTypes::GE );
215195 }
216196
217197 public static function gtIterator () : self
218198 {
219- $ self = new self ();
220- $ self ->iteratorType = IteratorTypes::GT ;
221-
222- return $ self ;
199+ return self ::iteratorType (IteratorTypes::GT );
223200 }
224201
225202 public function andGtIterator () : self
226203 {
227- $ new = clone $ this ;
228- $ new ->iteratorType = IteratorTypes::GT ;
229-
230- return $ new ;
204+ return $ this ->andIteratorType (IteratorTypes::GT );
231205 }
232206
233207 public static function bitsAllSetIterator () : self
234208 {
235- $ self = new self ();
236- $ self ->iteratorType = IteratorTypes::BITS_ALL_SET ;
237-
238- return $ self ;
209+ return self ::iteratorType (IteratorTypes::BITS_ALL_SET );
239210 }
240211
241212 public function andBitsAllSetIterator () : self
242213 {
243- $ new = clone $ this ;
244- $ new ->iteratorType = IteratorTypes::BITS_ALL_SET ;
245-
246- return $ new ;
214+ return $ this ->andIteratorType (IteratorTypes::BITS_ALL_SET );
247215 }
248216
249217 public static function bitsAnySetIterator () : self
250218 {
251- $ self = new self ();
252- $ self ->iteratorType = IteratorTypes::BITS_ANY_SET ;
253-
254- return $ self ;
219+ return self ::iteratorType (IteratorTypes::BITS_ANY_SET );
255220 }
256221
257222 public function andBitsAnySetIterator () : self
258223 {
259- $ new = clone $ this ;
260- $ new ->iteratorType = IteratorTypes::BITS_ANY_SET ;
261-
262- return $ new ;
224+ return $ this ->andIteratorType (IteratorTypes::BITS_ANY_SET );
263225 }
264226
265227 public static function bitsAllNotSetIterator () : self
266228 {
267- $ self = new self ();
268- $ self ->iteratorType = IteratorTypes::BITS_ALL_NOT_SET ;
269-
270- return $ self ;
229+ return self ::iteratorType (IteratorTypes::BITS_ALL_NOT_SET );
271230 }
272231
273232 public function andBitsAllNotSetIterator () : self
274233 {
275- $ new = clone $ this ;
276- $ new ->iteratorType = IteratorTypes::BITS_ALL_NOT_SET ;
277-
278- return $ new ;
234+ return $ this ->andIteratorType (IteratorTypes::BITS_ALL_NOT_SET );
279235 }
280236
281237 public static function overlapsIterator () : self
282238 {
283- $ self = new self ();
284- $ self ->iteratorType = IteratorTypes::OVERLAPS ;
285-
286- return $ self ;
239+ return self ::iteratorType (IteratorTypes::OVERLAPS );
287240 }
288241
289242 public function andOverlapsIterator () : self
290243 {
291- $ new = clone $ this ;
292- $ new ->iteratorType = IteratorTypes::OVERLAPS ;
293-
294- return $ new ;
244+ return $ this ->andIteratorType (IteratorTypes::OVERLAPS );
295245 }
296246
297247 public static function neighborIterator () : self
298248 {
299- $ self = new self ();
300- $ self ->iteratorType = IteratorTypes::NEIGHBOR ;
301-
302- return $ self ;
249+ return self ::iteratorType (IteratorTypes::NEIGHBOR );
303250 }
304251
305252 public function andNeighborIterator () : self
306253 {
307- $ new = clone $ this ;
308- $ new ->iteratorType = IteratorTypes::NEIGHBOR ;
309-
310- return $ new ;
254+ return $ this ->andIteratorType (IteratorTypes::NEIGHBOR );
311255 }
312256
313257 public function getIteratorType () : int
0 commit comments