Created
April 23, 2023 09:13
-
-
Save olleharstedt/c140970d536a3799ef888c503864b34a to your computer and use it in GitHub Desktop.
Revisions
-
olleharstedt created this gist
Apr 23, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ function getAttributesFromTheme(string $themeName) { $theme = $this->getTheme($themeName); if (empty($theme)) { return null; } $xml = $this->getXmlFile($theme->path); if (empty($xml)) { return null; } return $this->extractAttributes($xml); } function caller() { $attributes = getAttributesFromTheme('mytheme'); } function getAttributesFromTheme() { return Pipe::make( $this->getXmlFile(...), $this->extractAttributes(...) )->stopIfEmpty(); } function caller() { $attributes = getAttributesFromTheme()->run(getTheme('mytheme')); }