@@ -211,8 +211,8 @@ public function count()
211
211
*/
212
212
public function isEqual (EnumSet $ other )
213
213
{
214
- return $ this ->getEnumeration () === $ other ->getEnumeration ()
215
- && $ this ->getBinaryBitsetLe () === $ other ->getBinaryBitsetLe () ;
214
+ return $ this ->enumeration === $ other ->enumeration
215
+ && $ this ->bitset === $ other ->bitset ;
216
216
}
217
217
218
218
/**
@@ -222,12 +222,11 @@ public function isEqual(EnumSet $other)
222
222
*/
223
223
public function isSubset (EnumSet $ other )
224
224
{
225
- if ($ this ->getEnumeration () !== $ other ->getEnumeration () ) {
225
+ if ($ this ->enumeration !== $ other ->enumeration ) {
226
226
return false ;
227
227
}
228
228
229
- $ thisBitset = $ this ->getBinaryBitsetLe ();
230
- return ($ thisBitset & $ other ->getBinaryBitsetLe ()) === $ thisBitset ;
229
+ return ($ this ->bitset & $ other ->bitset ) === $ this ->bitset ;
231
230
}
232
231
233
232
/**
@@ -237,12 +236,11 @@ public function isSubset(EnumSet $other)
237
236
*/
238
237
public function isSuperset (EnumSet $ other )
239
238
{
240
- if ($ this ->getEnumeration () !== $ other ->getEnumeration () ) {
239
+ if ($ this ->enumeration !== $ other ->enumeration ) {
241
240
return false ;
242
241
}
243
242
244
- $ thisBitset = $ this ->getBinaryBitsetLe ();
245
- return ($ thisBitset | $ other ->getBinaryBitsetLe ()) === $ thisBitset ;
243
+ return ($ this ->bitset | $ other ->bitset ) === $ this ->bitset ;
246
244
}
247
245
248
246
/**
@@ -375,9 +373,10 @@ public function getOrdinals()
375
373
*/
376
374
public function getValues ()
377
375
{
378
- $ values = array ();
379
- foreach ($ this ->getEnumerators () as $ enumerator ) {
380
- $ values [] = $ enumerator ->getValue ();
376
+ $ enumeration = $ this ->enumeration ;
377
+ $ values = array ();
378
+ foreach ($ this ->getOrdinals () as $ ord ) {
379
+ $ values [] = $ enumeration ::getByOrdinal ($ ord )->getValue ();
381
380
}
382
381
return $ values ;
383
382
}
@@ -388,9 +387,10 @@ public function getValues()
388
387
*/
389
388
public function getNames ()
390
389
{
391
- $ names = array ();
392
- foreach ($ this ->getEnumerators () as $ enumerator ) {
393
- $ names [] = $ enumerator ->getName ();
390
+ $ enumeration = $ this ->enumeration ;
391
+ $ names = array ();
392
+ foreach ($ this ->getOrdinals () as $ ord ) {
393
+ $ names [] = $ enumeration ::getByOrdinal ($ ord )->getName ();
394
394
}
395
395
return $ names ;
396
396
}
0 commit comments