@@ -156,7 +156,7 @@ public function getIterator(): Iterator
156
156
* @see getIterator()
157
157
* @see goGetIteratorInt()
158
158
*/
159
- private function doGetIteratorBin (): Iterator
159
+ private function doGetIteratorBin ()
160
160
{
161
161
$ bitset = $ this ->bitset ;
162
162
$ byteLen = \strlen ($ bitset );
@@ -185,7 +185,7 @@ private function doGetIteratorBin(): Iterator
185
185
* @see getIterator()
186
186
* @see doGetIteratorBin()
187
187
*/
188
- private function doGetIteratorInt (): Iterator
188
+ private function doGetIteratorInt ()
189
189
{
190
190
$ count = $ this ->enumerationCount ;
191
191
$ bitset = $ this ->bitset ;
@@ -219,7 +219,7 @@ public function count(): int
219
219
* @see count()
220
220
* @see doCountInt()
221
221
*/
222
- private function doCountBin (): int
222
+ private function doCountBin ()
223
223
{
224
224
$ count = 0 ;
225
225
$ bitset = $ this ->bitset ;
@@ -252,7 +252,7 @@ private function doCountBin(): int
252
252
* @see count()
253
253
* @see doCountBin()
254
254
*/
255
- private function doCountInt (): int
255
+ private function doCountInt ()
256
256
{
257
257
$ count = 0 ;
258
258
$ bitset = $ this ->bitset ;
@@ -325,10 +325,10 @@ public function isSuperset(EnumSet $other): bool
325
325
* Produce a new set with enumerators from both this and other (this | other)
326
326
*
327
327
* @param EnumSet $other EnumSet of the same enumeration to produce the union
328
- * @return EnumSet
328
+ * @return static
329
329
* @throws InvalidArgumentException If $other doesn't match the enumeration
330
330
*/
331
- public function union (EnumSet $ other ): EnumSet
331
+ public function union (EnumSet $ other ): self
332
332
{
333
333
if ($ this ->enumeration !== $ other ->enumeration ) {
334
334
throw new InvalidArgumentException (\sprintf (
@@ -346,10 +346,10 @@ public function union(EnumSet $other): EnumSet
346
346
* Produce a new set with enumerators common to both this and other (this & other)
347
347
*
348
348
* @param EnumSet $other EnumSet of the same enumeration to produce the intersect
349
- * @return EnumSet
349
+ * @return static
350
350
* @throws InvalidArgumentException If $other doesn't match the enumeration
351
351
*/
352
- public function intersect (EnumSet $ other ): EnumSet
352
+ public function intersect (EnumSet $ other ): self
353
353
{
354
354
if ($ this ->enumeration !== $ other ->enumeration ) {
355
355
throw new InvalidArgumentException (\sprintf (
@@ -367,10 +367,10 @@ public function intersect(EnumSet $other): EnumSet
367
367
* Produce a new set with enumerators in this but not in other (this - other)
368
368
*
369
369
* @param EnumSet $other EnumSet of the same enumeration to produce the diff
370
- * @return EnumSet
370
+ * @return static
371
371
* @throws InvalidArgumentException If $other doesn't match the enumeration
372
372
*/
373
- public function diff (EnumSet $ other ): EnumSet
373
+ public function diff (EnumSet $ other ): self
374
374
{
375
375
if ($ this ->enumeration !== $ other ->enumeration ) {
376
376
throw new InvalidArgumentException (\sprintf (
@@ -388,10 +388,10 @@ public function diff(EnumSet $other): EnumSet
388
388
* Produce a new set with enumerators in either this and other but not in both (this ^ other)
389
389
*
390
390
* @param EnumSet $other EnumSet of the same enumeration to produce the symmetric difference
391
- * @return EnumSet
391
+ * @return static
392
392
* @throws InvalidArgumentException If $other doesn't match the enumeration
393
393
*/
394
- public function symDiff (EnumSet $ other ): EnumSet
394
+ public function symDiff (EnumSet $ other ): self
395
395
{
396
396
if ($ this ->enumeration !== $ other ->enumeration ) {
397
397
throw new InvalidArgumentException (\sprintf (
@@ -425,7 +425,7 @@ public function getOrdinals(): array
425
425
* @see getOrdinals()
426
426
* @see goGetOrdinalsInt()
427
427
*/
428
- private function doGetOrdinalsBin (): array
428
+ private function doGetOrdinalsBin ()
429
429
{
430
430
$ ordinals = [];
431
431
$ bitset = $ this ->bitset ;
@@ -455,7 +455,7 @@ private function doGetOrdinalsBin(): array
455
455
* @see getOrdinals()
456
456
* @see doGetOrdinalsBin()
457
457
*/
458
- private function doGetOrdinalsInt (): array
458
+ private function doGetOrdinalsInt ()
459
459
{
460
460
$ ordinals = [];
461
461
$ count = $ this ->enumerationCount ;
@@ -531,7 +531,7 @@ public function getBinaryBitsetLe(): string
531
531
* @see getBinaryBitsetLe()
532
532
* @see doGetBinaryBitsetLeInt()
533
533
*/
534
- private function doGetBinaryBitsetLeBin (): string
534
+ private function doGetBinaryBitsetLeBin ()
535
535
{
536
536
return $ this ->bitset ;
537
537
}
@@ -545,7 +545,7 @@ private function doGetBinaryBitsetLeBin(): string
545
545
* @see getBinaryBitsetLe()
546
546
* @see doGetBinaryBitsetLeBin()
547
547
*/
548
- private function doGetBinaryBitsetLeInt (): string
548
+ private function doGetBinaryBitsetLeInt ()
549
549
{
550
550
$ bin = \pack (\PHP_INT_SIZE === 8 ? 'P ' : 'V ' , $ this ->bitset );
551
551
return \substr ($ bin , 0 , (int )\ceil ($ this ->enumerationCount / 8 ));
@@ -578,7 +578,7 @@ public function setBinaryBitsetLe(string $bitset): void
578
578
* @see setBinaryBitsetLeBin()
579
579
* @see doSetBinaryBitsetLeInt()
580
580
*/
581
- private function doSetBinaryBitsetLeBin (string $ bitset ): void
581
+ private function doSetBinaryBitsetLeBin ($ bitset ): void
582
582
{
583
583
$ size = \strlen ($ this ->bitset );
584
584
$ sizeIn = \strlen ($ bitset );
@@ -619,7 +619,7 @@ private function doSetBinaryBitsetLeBin(string $bitset): void
619
619
* @see setBinaryBitsetLeBin()
620
620
* @see doSetBinaryBitsetLeBin()
621
621
*/
622
- private function doSetBinaryBitsetLeInt (string $ bitset ): void
622
+ private function doSetBinaryBitsetLeInt ($ bitset ): void
623
623
{
624
624
$ len = \strlen ($ bitset );
625
625
$ int = 0 ;
@@ -692,7 +692,7 @@ public function getBit(int $ordinal): bool
692
692
* @see getBit()
693
693
* @see doGetBitInt()
694
694
*/
695
- private function doGetBitBin (int $ ordinal ): bool
695
+ private function doGetBitBin ($ ordinal )
696
696
{
697
697
return (\ord ($ this ->bitset [(int ) ($ ordinal / 8 )]) & 1 << ($ ordinal % 8 )) !== 0 ;
698
698
}
@@ -707,7 +707,7 @@ private function doGetBitBin(int $ordinal): bool
707
707
* @see getBit()
708
708
* @see doGetBitBin()
709
709
*/
710
- private function doGetBitInt (int $ ordinal ): bool
710
+ private function doGetBitInt ($ ordinal )
711
711
{
712
712
return (bool )($ this ->bitset & (1 << $ ordinal ));
713
713
}
@@ -747,7 +747,7 @@ public function setBit(int $ordinal, bool $bit): void
747
747
* @see setBit()
748
748
* @see doSetBitInt()
749
749
*/
750
- private function doSetBitBin (int $ ordinal ): void
750
+ private function doSetBitBin ($ ordinal ): void
751
751
{
752
752
$ byte = (int ) ($ ordinal / 8 );
753
753
$ this ->bitset [$ byte ] = $ this ->bitset [$ byte ] | \chr (1 << ($ ordinal % 8 ));
@@ -763,7 +763,7 @@ private function doSetBitBin(int $ordinal): void
763
763
* @see setBit()
764
764
* @see doSetBitBin()
765
765
*/
766
- private function doSetBitInt (int $ ordinal ): void
766
+ private function doSetBitInt ($ ordinal ): void
767
767
{
768
768
$ this ->bitset = $ this ->bitset | (1 << $ ordinal );
769
769
}
@@ -778,7 +778,7 @@ private function doSetBitInt(int $ordinal): void
778
778
* @see setBit()
779
779
* @see doUnsetBitInt()
780
780
*/
781
- private function doUnsetBitBin (int $ ordinal ): void
781
+ private function doUnsetBitBin ($ ordinal ): void
782
782
{
783
783
$ byte = (int ) ($ ordinal / 8 );
784
784
$ this ->bitset [$ byte ] = $ this ->bitset [$ byte ] & \chr (~(1 << ($ ordinal % 8 )));
@@ -794,7 +794,7 @@ private function doUnsetBitBin(int $ordinal): void
794
794
* @see setBit()
795
795
* @see doUnsetBitBin()
796
796
*/
797
- private function doUnsetBitInt (int $ ordinal ): void
797
+ private function doUnsetBitInt ($ ordinal ): void
798
798
{
799
799
$ this ->bitset = $ this ->bitset & ~(1 << $ ordinal );
800
800
}
0 commit comments