Skip to content

Commit

Permalink
Create the abstract class.
Browse files Browse the repository at this point in the history
  • Loading branch information
7r1n17y committed Jul 9, 2017
1 parent 8c5f499 commit 5da89e3
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion src/Extender.php
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@

<?php
abstract class Extender {
private $_exts = array();
public $_this;
function __construct() {
$_this = $this;
}
public function add_ext($object) {
$this->_exts[] = $object;
}
public function __get($var_name) {
foreach($this->_exts as $ext) {
if (property_exists($ext, $var_name)) {
return $ext->$varname;
}
}
}
public function __call($method, $args) {
foreach($this->_exts as $ext) {
if (method_exists($ext, $method)) {
return call_user_method_array($method,$ext,$args);
}
}
throw new Exception("This Method {$method} doesn't exists");
}


}
?>

0 comments on commit 5da89e3

Please sign in to comment.