robclancy/presenter — pull request #25 by BenConstable (2014-04-08 12:01:11+00:00)
Title: Check 'present' methods in isset() implementation

I've updated the `isset()` and `offsetExists()` methods to check for the existence of `present{$VariableName}` methods and their result, meaning that you can now do:

```php
firstname . ' ' . $this->lastname;
}

public function presentNothing()
{
return null;
}
}

$presenter = new MyPresenter(new MyObject());

isset($presenter->firstname); // true
isset($presenter->lastname); // true
isset($presenter->fullname); // true
isset($presenter->nothing); // false
isset($presenter->notset); // false
```

This also works with arrays:

```php
'First', 'lastname' => 'Last'));

isset($presenter['firstname']); // true
isset($presenter['lastname']); // true
isset($presenter['fullname']); // true
isset($presenter['notset']); // false
```

Hopefully this is something that you'll find useful. I've updated the unit tests to cover the changes.