Take following example:

```php
class Foo
{
    public $counter = 0;
    public function doFoo()
    {
        $this->counter += 1;

        return $this;
    }
}
```

Then proxy it:

```php
$pf = new ProxyManager\Factory\AccessInterceptorValueHolderFactory();

$proxy = $pf->createProxy(new Foo(), ['doFoo' => function () { echo 'called doFoo'; }]);
```

Then try:

```php
$proxy->doFoo()->doFoo()->doFoo()->doFoo();
```