| 1 | <?php  | 
            ||
| 9 | abstract class ParentDelegationBuilder implements Builder  | 
            ||
| 10 | { | 
            ||
| 11 | /**  | 
            ||
| 12 | * The parent Builder, if this is a child Builder  | 
            ||
| 13 | * @var Builder  | 
            ||
| 14 | */  | 
            ||
| 15 | private $parentContext;  | 
            ||
| 16 | |||
| 17 | /**  | 
            ||
| 18 | * Builds the configuration  | 
            ||
| 19 | * @return array configuration  | 
            ||
| 20 | */  | 
            ||
| 21 | abstract public function build();  | 
            ||
| 22 | |||
| 23 | /**  | 
            ||
| 24 | * @param Builder $builder  | 
            ||
| 25 | */  | 
            ||
| 26 | public function setParentContext(Builder $builder)  | 
            ||
| 30 | |||
| 31 | /**  | 
            ||
| 32 | * @return Builder  | 
            ||
| 33 | */  | 
            ||
| 34 | public function getParentContext()  | 
            ||
| 38 | |||
| 39 | /**  | 
            ||
| 40 | * If a method is missing, check to see if it exist on the $parentContext  | 
            ||
| 41 | * and delegate the call to it.  | 
            ||
| 42 | * @param string $method  | 
            ||
| 43 | * @param array $args  | 
            ||
| 44 | * @throws \Exception when a method is not found on the $parentContext  | 
            ||
| 45 | * @return mixed  | 
            ||
| 46 | */  | 
            ||
| 47 | public function __call($method, $args)  | 
            ||
| 55 | }  | 
            ||
| 56 |