Created
April 23, 2023 09:13
-
-
Save olleharstedt/c140970d536a3799ef888c503864b34a to your computer and use it in GitHub Desktop.
This file contains 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 characters
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')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment