marc-mabe / php-enum

Simple and fast implementation of enumerations with native PHP
BSD 3-Clause "New" or "Revised" License
464 stars 36 forks source link

Enum::is() not working on inherited enumerations #42

Closed marc-mabe closed 10 years ago

marc-mabe commented 10 years ago
class HttpMethodEnum extends \MabeEnum\Enum {
    const GET = 'GET';
    // ...
}
class WebDavMethodEnum extends HttpMethodEnum { /* ... */ }

$get1 = HttpMethodEnum::get('GET');
$get2 = WebDavMethodEnum::get('GET');
var_dump($get1 === $get2);  // false
var_dump($get1->is($get2)); // true
var_dump($get2->is($get1)); // false <- this should be true !!!
marc-mabe commented 9 years ago

Needs to be reverted - see #47