/** * Apply the preset to the given component. * * @param Component $component */ function apply(Component $component) { if ($this->props) { $component->props->applyDefaults($this->props); } if ($this->unset) { foreach ($this->unset as $prop) { unset($component->props->{$prop}); } } if ($this->content) { $component->removeChildren(); Metadata::compile($this->content, $component); } if ($this->prepend) { Metadata::compile($this->prepend, $component, true); } if ($this->append) { Metadata::compile($this->append, $component); } }