src/AbstractEnumSet.php 1 location
|
@@ 44-50 (lines=7) @@
|
41 |
|
*/ |
42 |
|
public function __construct($enumeration) |
43 |
|
{ |
44 |
|
if (!is_subclass_of($enumeration, Enum::class)) { |
45 |
|
throw new InvalidArgumentException(sprintf( |
46 |
|
"%s can handle subclasses of '%s' only", |
47 |
|
static::class, |
48 |
|
Enum::class |
49 |
|
)); |
50 |
|
} |
51 |
|
|
52 |
|
$this->enumeration = $enumeration; |
53 |
|
$this->ordinalMax = count($enumeration::getConstants()); |
src/EnumSet.php 1 location
|
@@ 68-74 (lines=7) @@
|
65 |
|
*/ |
66 |
|
public function __construct($enumeration) |
67 |
|
{ |
68 |
|
if (!is_subclass_of($enumeration, Enum::class)) { |
69 |
|
throw new InvalidArgumentException(sprintf( |
70 |
|
"%s can handle subclasses of '%s' only", |
71 |
|
static::class, |
72 |
|
Enum::class |
73 |
|
)); |
74 |
|
} |
75 |
|
|
76 |
|
$this->enumeration = $enumeration; |
77 |
|
$this->ordinalMax = count($enumeration::getConstants()); |