peridot-php/peridot — pull request #66 by brianium (2014-10-26 19:31:42+00:00)
Title: Scope method and property lookup should traverse children

Currently, scope method and property lookup only happens against immediate children of a scope. So this scenario would be broken:

```php
$parent = new Scope();
$testScope = new TestScope(); //TestScope defines ->getNumber()
$testScope->peridotAddChildScope(new TestChildScope()); //TestChildScope defines ->getEvenNumber()
$parent->peridotAddChildScope($testScope);

$number = $parent->getNumber(); //this is fine
$evenNumber = $parent->getEvenNumber(); //this would not be fine
```

This PR makes the method and property lookup recursive. Scope hierarchies will be traversed until a method or property is found, only throwing exceptions once all children have been searched.