Skip to content

Commit 848250b

Browse files
committed
fix #68: removed deprecated
1 parent 9803f7f commit 848250b

File tree

6 files changed

+5
-130
lines changed

6 files changed

+5
-130
lines changed

src/Enum.php

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -252,48 +252,6 @@ final public static function byOrdinal($ordinal)
252252
return self::$instances[$class][$name] = new $class(current($item), $ordinal);
253253
}
254254

255-
/**
256-
* Get an enumerator instance by the given name
257-
*
258-
* @param string $name The name of the enumerator
259-
* @return static
260-
* @throws InvalidArgumentException On an invalid or unknown name
261-
* @throws LogicException On ambiguous values
262-
* @deprecated
263-
*/
264-
final public static function getByName($name)
265-
{
266-
return static::byName($name);
267-
}
268-
269-
/**
270-
* Get an enumeration instance by the given ordinal number
271-
*
272-
* @param int $ordinal The ordinal number or the enumerator
273-
* @return static
274-
* @throws InvalidArgumentException On an invalid ordinal number
275-
* @throws LogicException On ambiguous values
276-
* @deprecated
277-
*/
278-
final public static function getByOrdinal($ordinal)
279-
{
280-
return static::byOrdinal($ordinal);
281-
}
282-
283-
/**
284-
* Clear all instantiated enumerators of the called class
285-
*
286-
* NOTE: This can break singleton behavior ... use it with caution!
287-
*
288-
* @return void
289-
* @deprecated
290-
*/
291-
final public static function clear()
292-
{
293-
$class = get_called_class();
294-
unset(self::$instances[$class], self::$constants[$class]);
295-
}
296-
297255
/**
298256
* Get a list of enumerator instances ordered by ordinal number
299257
*

src/EnumMap.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,6 @@ public function __construct($enumeration, $flags = null)
9595
}
9696
}
9797

98-
/**
99-
* Get the classname of the enumeration
100-
* @return string
101-
* @deprecated Please use getEnumeration() instead
102-
*/
103-
public function getEnumClass()
104-
{
105-
return $this->getEnumeration();
106-
}
107-
10898
/**
10999
* Get the classname of the enumeration
110100
* @return string

src/EnumSet.php

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,6 @@ public function __construct($enumeration)
6161
$this->bitset = str_repeat("\0", ceil($this->ordinalMax / 8));
6262
}
6363

64-
/**
65-
* Get the classname of enumeration this set is for
66-
* @return string
67-
* @deprecated Please use getEnumeration() instead
68-
*/
69-
public function getEnumClass()
70-
{
71-
return $this->getEnumeration();
72-
}
73-
7464
/**
7565
* Get the classname of the enumeration
7666
* @return string
@@ -484,31 +474,6 @@ public function setBinaryBitsetBe($bitset)
484474
$this->setBinaryBitsetLe(strrev($bitset));
485475
}
486476

487-
/**
488-
* Get the binary bitset
489-
*
490-
* @return string Returns the binary bitset in big-endian order
491-
* @deprecated Please use getBinaryBitsetBe() instead
492-
*/
493-
public function getBitset()
494-
{
495-
return $this->getBinaryBitsetBe();
496-
}
497-
498-
/**
499-
* Set the bitset.
500-
* NOTE: It resets the current position of the iterator
501-
*
502-
* @param string $bitset The binary bitset in big-endian order
503-
* @return void
504-
* @throws InvalidArgumentException On a non string is given as Parameter
505-
* @deprecated Please use setBinaryBitsetBe() instead
506-
*/
507-
public function setBitset($bitset)
508-
{
509-
$this->setBinaryBitsetBe($bitset);
510-
}
511-
512477
/**
513478
* Get a bit at the given ordinal number
514479
*

tests/MabeEnumTest/EnumMapTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ public function testBasic()
4747
$this->assertFalse($enumMap->contains($enum2));
4848
}
4949

50-
public function testDeprecatedGetEnumClass()
51-
{
52-
$enumMap = new EnumMap('MabeEnumTest\TestAsset\EnumBasic');
53-
$this->assertSame('MabeEnumTest\TestAsset\EnumBasic', $enumMap->getEnumClass());
54-
}
55-
5650
public function testBasicWithConstantValuesAsEnums()
5751
{
5852
$enumMap = new EnumMap('MabeEnumTest\TestAsset\EnumBasic');

tests/MabeEnumTest/EnumSetTest.php

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ public function testBasic()
4444
$this->assertFalse($enumSet->contains($enum2));
4545
}
4646

47-
public function testDeprecatedGetEnumClass()
48-
{
49-
$enumSet = new EnumSet('MabeEnumTest\TestAsset\EnumBasic');
50-
$this->assertSame('MabeEnumTest\TestAsset\EnumBasic', $enumSet->getEnumClass());
51-
}
52-
5347
public function testBasicWithConstantValuesAsEnums()
5448
{
5549
$enumSet = new EnumSet('MabeEnumTest\TestAsset\EnumBasic');
@@ -333,25 +327,25 @@ public function testGetBitset()
333327
$enum4 = Enum65::SIXTYFOUR;
334328

335329
$this->assertNull($enumSet->attach($enum1));
336-
$this->assertSame("\x00\x00\x00\x00\x00\x00\x00\x00\x01", $enumSet->getBitset());
330+
$this->assertSame("\x00\x00\x00\x00\x00\x00\x00\x00\x01", $enumSet->getBinaryBitsetBe());
337331
$this->assertTrue($enumSet->contains($enum1));
338332

339333
$this->assertNull($enumSet->attach($enum2));
340-
$this->assertSame("\x00\x00\x00\x00\x00\x00\x00\x00\x03", $enumSet->getBitset());
334+
$this->assertSame("\x00\x00\x00\x00\x00\x00\x00\x00\x03", $enumSet->getBinaryBitsetBe());
341335
$this->assertTrue($enumSet->contains($enum2));
342336

343337
$this->assertNull($enumSet->attach($enum3));
344-
$this->assertSame("\x01\x00\x00\x00\x00\x00\x00\x00\x03", $enumSet->getBitset());
338+
$this->assertSame("\x01\x00\x00\x00\x00\x00\x00\x00\x03", $enumSet->getBinaryBitsetBe());
345339
$this->assertTrue($enumSet->contains($enum3));
346340

347341
$this->assertNull($enumSet->attach($enum4));
348-
$this->assertSame("\x01\x80\x00\x00\x00\x00\x00\x00\x03", $enumSet->getBitset());
342+
$this->assertSame("\x01\x80\x00\x00\x00\x00\x00\x00\x03", $enumSet->getBinaryBitsetBe());
349343
$this->assertTrue($enumSet->contains($enum4));
350344

351345
$this->assertSame(4, $enumSet->count());
352346

353347
$this->assertNull($enumSet->detach($enum2));
354-
$this->assertSame("\x01\x80\x00\x00\x00\x00\x00\x00\x01", $enumSet->getBitset());
348+
$this->assertSame("\x01\x80\x00\x00\x00\x00\x00\x00\x01", $enumSet->getBinaryBitsetBe());
355349
$this->assertFalse($enumSet->contains($enum2));
356350

357351
$this->assertSame(3, $enumSet->count());
@@ -398,21 +392,6 @@ public function testSetBinaryBitsetBe()
398392
$this->assertTrue($enumSet->count() == 3);
399393
}
400394

401-
/**
402-
* @deprecated
403-
*/
404-
public function testSetBitset()
405-
{
406-
$enumSet = new EnumSet('MabeEnumTest\TestAsset\Enum65');
407-
$enumSet->setBitset("\x01\x80\x00\x00\x00\x00\x00\x00\x01");
408-
409-
$this->assertTrue($enumSet->contains(Enum65::ONE));
410-
$this->assertFalse($enumSet->contains(Enum65::TWO));
411-
$this->assertTrue($enumSet->contains(Enum65::SIXTYFIVE));
412-
$this->assertTrue($enumSet->contains(Enum65::SIXTYFOUR));
413-
$this->assertTrue($enumSet->count() == 3);
414-
}
415-
416395
public function testSetBinaryBitsetLeShort()
417396
{
418397
$enumSet = new EnumSet('MabeEnumTest\TestAsset\Enum65');

tests/MabeEnumTest/EnumTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -243,17 +243,6 @@ public function testSingleton()
243243
$this->assertSame($enum1, $enum2);
244244
}
245245

246-
public function testClear()
247-
{
248-
$enum1 = EnumBasic::ONE();
249-
EnumBasic::clear();
250-
$enum2 = EnumBasic::ONE();
251-
$enum3 = EnumBasic::ONE();
252-
253-
$this->assertNotSame($enum1, $enum2);
254-
$this->assertSame($enum2, $enum3);
255-
}
256-
257246
public function testCloneNotCallableAndThrowsLogicException()
258247
{
259248
$enum = EnumBasic::ONE();

0 commit comments

Comments
 (0)