The [schmittjoh/cg-library](https://github.com/schmittjoh/cg-library) seems what I need, but there is no documentation at all. 

> 
> This library provides some tools that you commonly need for generating
>  PHP code. One of it's strength lies in the enhancement of existing
>  classes with behaviors.
> 
> 
> 

Given `A` class:

```php
class A {}

```

I'd like to modify, at runtime of course and with some cache mechanism, class `A`, making it implementing a given interface:

```php
interface I
{
    public function mustImplement();
}

```

... with a "default" implementation for method `mustImplement()` in `A` class.