Skip to content

Commit e2f45c8

Browse files
committed
better comment, fixed typo
1 parent 1aadf44 commit e2f45c8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/MabeEnum/Enum.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,12 @@ final static public function get($value)
129129

130130
// find the real value
131131
$constants = self::detectConstants($class);
132-
$name = array_search($value, $constants, true);
132+
$name = array_search($value, $constants, true); // use strict, see next lines
133133
if ($name === false) {
134-
// enumeration values have to be unique by their string representation
135-
// because array_search search in strict more or in non-strict mode we
136-
// have to search for a value of the same string out self.
134+
// Bnumeration values have to be unique by their string representation.
135+
// Because array_search searches in strict mode or in non-strict mode only
136+
// we have to search for a value of the same string our self.
137+
// (see issue #26)
137138
$valueStr = (string) $value;
138139
$found = false;
139140
foreach ($constants as $name => $constValue) {

0 commit comments

Comments
 (0)