@@ -118,196 +118,140 @@ public function getOffset() : int
118
118
return $ this ->offset ;
119
119
}
120
120
121
- public static function eqIterator ( ) : self
121
+ public static function iteratorType ( int $ iteratorType ) : self
122
122
{
123
123
$ self = new self ();
124
- $ self ->iteratorType = IteratorTypes:: EQ ;
124
+ $ self ->iteratorType = $ iteratorType ;
125
125
126
126
return $ self ;
127
127
}
128
128
129
- public function andEqIterator ( ) : self
129
+ public function andIteratorType ( int $ iteratorType ) : self
130
130
{
131
131
$ new = clone $ this ;
132
- $ new ->iteratorType = IteratorTypes:: EQ ;
132
+ $ new ->iteratorType = $ iteratorType ;
133
133
134
134
return $ new ;
135
135
}
136
136
137
- public static function reqIterator () : self
137
+ public static function eqIterator () : self
138
138
{
139
- $ self = new self ( );
140
- $ self -> iteratorType = IteratorTypes:: REQ ;
139
+ return self :: iteratorType (IteratorTypes:: EQ );
140
+ }
141
141
142
- return $ self ;
142
+ public function andEqIterator () : self
143
+ {
144
+ return $ this ->andIteratorType (IteratorTypes::EQ );
143
145
}
144
146
145
- public function andReqIterator () : self
147
+ public static function reqIterator () : self
146
148
{
147
- $ new = clone $ this ;
148
- $ new -> iteratorType = IteratorTypes:: REQ ;
149
+ return self :: iteratorType (IteratorTypes:: REQ ) ;
150
+ }
149
151
150
- return $ new ;
152
+ public function andReqIterator () : self
153
+ {
154
+ return $ this ->andIteratorType (IteratorTypes::REQ );
151
155
}
152
156
153
157
public static function allIterator () : self
154
158
{
155
- $ self = new self ();
156
- $ self ->iteratorType = IteratorTypes::ALL ;
157
-
158
- return $ self ;
159
+ return self ::iteratorType (IteratorTypes::ALL );
159
160
}
160
161
161
162
public function andAllIterator () : self
162
163
{
163
- $ new = clone $ this ;
164
- $ new ->iteratorType = IteratorTypes::ALL ;
165
-
166
- return $ new ;
164
+ return $ this ->andIteratorType (IteratorTypes::ALL );
167
165
}
168
166
169
167
public static function ltIterator () : self
170
168
{
171
- $ self = new self ();
172
- $ self ->iteratorType = IteratorTypes::LT ;
173
-
174
- return $ self ;
169
+ return self ::iteratorType (IteratorTypes::LT );
175
170
}
176
171
177
172
public function andLtIterator () : self
178
173
{
179
- $ new = clone $ this ;
180
- $ new ->iteratorType = IteratorTypes::LT ;
181
-
182
- return $ new ;
174
+ return $ this ->andIteratorType (IteratorTypes::LT );
183
175
}
184
176
185
177
public static function leIterator () : self
186
178
{
187
- $ self = new self ();
188
- $ self ->iteratorType = IteratorTypes::LE ;
189
-
190
- return $ self ;
179
+ return self ::iteratorType (IteratorTypes::LE );
191
180
}
192
181
193
182
public function andLeIterator () : self
194
183
{
195
- $ new = clone $ this ;
196
- $ new ->iteratorType = IteratorTypes::LE ;
197
-
198
- return $ new ;
184
+ return $ this ->andIteratorType (IteratorTypes::LE );
199
185
}
200
186
201
187
public static function geIterator () : self
202
188
{
203
- $ self = new self ();
204
- $ self ->iteratorType = IteratorTypes::GE ;
205
-
206
- return $ self ;
189
+ return self ::iteratorType (IteratorTypes::GE );
207
190
}
208
191
209
192
public function andGeIterator () : self
210
193
{
211
- $ new = clone $ this ;
212
- $ new ->iteratorType = IteratorTypes::GE ;
213
-
214
- return $ new ;
194
+ return $ this ->andIteratorType (IteratorTypes::GE );
215
195
}
216
196
217
197
public static function gtIterator () : self
218
198
{
219
- $ self = new self ();
220
- $ self ->iteratorType = IteratorTypes::GT ;
221
-
222
- return $ self ;
199
+ return self ::iteratorType (IteratorTypes::GT );
223
200
}
224
201
225
202
public function andGtIterator () : self
226
203
{
227
- $ new = clone $ this ;
228
- $ new ->iteratorType = IteratorTypes::GT ;
229
-
230
- return $ new ;
204
+ return $ this ->andIteratorType (IteratorTypes::GT );
231
205
}
232
206
233
207
public static function bitsAllSetIterator () : self
234
208
{
235
- $ self = new self ();
236
- $ self ->iteratorType = IteratorTypes::BITS_ALL_SET ;
237
-
238
- return $ self ;
209
+ return self ::iteratorType (IteratorTypes::BITS_ALL_SET );
239
210
}
240
211
241
212
public function andBitsAllSetIterator () : self
242
213
{
243
- $ new = clone $ this ;
244
- $ new ->iteratorType = IteratorTypes::BITS_ALL_SET ;
245
-
246
- return $ new ;
214
+ return $ this ->andIteratorType (IteratorTypes::BITS_ALL_SET );
247
215
}
248
216
249
217
public static function bitsAnySetIterator () : self
250
218
{
251
- $ self = new self ();
252
- $ self ->iteratorType = IteratorTypes::BITS_ANY_SET ;
253
-
254
- return $ self ;
219
+ return self ::iteratorType (IteratorTypes::BITS_ANY_SET );
255
220
}
256
221
257
222
public function andBitsAnySetIterator () : self
258
223
{
259
- $ new = clone $ this ;
260
- $ new ->iteratorType = IteratorTypes::BITS_ANY_SET ;
261
-
262
- return $ new ;
224
+ return $ this ->andIteratorType (IteratorTypes::BITS_ANY_SET );
263
225
}
264
226
265
227
public static function bitsAllNotSetIterator () : self
266
228
{
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 );
271
230
}
272
231
273
232
public function andBitsAllNotSetIterator () : self
274
233
{
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 );
279
235
}
280
236
281
237
public static function overlapsIterator () : self
282
238
{
283
- $ self = new self ();
284
- $ self ->iteratorType = IteratorTypes::OVERLAPS ;
285
-
286
- return $ self ;
239
+ return self ::iteratorType (IteratorTypes::OVERLAPS );
287
240
}
288
241
289
242
public function andOverlapsIterator () : self
290
243
{
291
- $ new = clone $ this ;
292
- $ new ->iteratorType = IteratorTypes::OVERLAPS ;
293
-
294
- return $ new ;
244
+ return $ this ->andIteratorType (IteratorTypes::OVERLAPS );
295
245
}
296
246
297
247
public static function neighborIterator () : self
298
248
{
299
- $ self = new self ();
300
- $ self ->iteratorType = IteratorTypes::NEIGHBOR ;
301
-
302
- return $ self ;
249
+ return self ::iteratorType (IteratorTypes::NEIGHBOR );
303
250
}
304
251
305
252
public function andNeighborIterator () : self
306
253
{
307
- $ new = clone $ this ;
308
- $ new ->iteratorType = IteratorTypes::NEIGHBOR ;
309
-
310
- return $ new ;
254
+ return $ this ->andIteratorType (IteratorTypes::NEIGHBOR );
311
255
}
312
256
313
257
public function getIteratorType () : int
0 commit comments