xp-framework/xp-framework — pull request #229 by thekid (2013-01-25 19:19:11+00:00)
Title: Enum simplify

This pull request goes a bit further than @ohinckel's #178 and simplifies creating enums by providing the functionality (for the easiest case) in the base class:

Previous:
```php
uses('lang.Enum');

class Weekday extends Enum {
public static $MON, $TUE, $WED, $THU, $FRI, $SAT, $SUN;

static function __static() {
self::$MON= new self(1, 'MON');
self::$TUE= new self(2, 'TUE');
// ...
}

public static function values() {
return parent::membersOf(__CLASS__);
}
}
```

New:
```php
class Weekday extends \lang\Enum {
public static $MON= 1, $TUE, $WED, $THU, $FRI, $SAT, $SUN;
}
```