public function inherit(AbstractTag $tag) { $group = $tag->getParentGroup(); if ($group) { $parent_style = $group->getStyle(); foreach ($parent_style as $_key => $_value) { if ($_value !== null) { $this->{$_key} = $_value; } } } }