public function __call($name, array $args)
{
$whitelist = array('className', 'innerHTML', 'outerHTML', 'text', 'value');
$method = lcfirst(substr($name, 3));
$operation = in_array($method, $whitelist) ? substr($name, 0, 3) : '';
switch ($operation) {
case 'set':
$this->setAttribute($method, $args[0]);
return $method != 'outerHTML' ? $this : null;
case 'get':
return $this->getAttribute($method);
break;
default:
throw new \Exception('Invalid magic call');
}
}