Dev Blog

A new release of addendum provides annotations for anonymous classes. One of anonymous classes feature is that these can be wrapped in another class. Fortunately PHP has support for reading doc comments from those classes, thus allowing to parse annotations. Addendum will create annotations container just like if it were named class.
Example of anonymous annotated class:
/**
* @Label('Class Name')
*/
$model = new class implements AnnotatedInterface {
/**
* @Label('Test label')
* @var type
*/
public $test = '';

/**
* @Label('Method Test')
*/
public function doSomething()
{}
};

It is even possible to create meta container using class name (by get_class method), however it is not recommended, better pass object instance:

$meta = Meta::create($model);

Now having meta container instance, it is possible to get metadata created by annotations:

echo $meta->test;

Above statement will print:

Test label