Last active
April 24, 2023 11:38
-
-
Save olleharstedt/353bab536750d7ec5a717f54c12e185a to your computer and use it in GitHub Desktop.
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 characters
<?php | |
function getAttributesFromTheme(string $themeName) | |
{ | |
$theme = $this->getTheme($themeName); | |
if (empty($theme)) { | |
return null; | |
} | |
$xml = $this->getXmlFromTheme($theme); | |
if (empty($xml)) { | |
return null; | |
} | |
return $this->extractAttributes($xml); | |
} | |
function caller() | |
{ | |
$attributes = $this->getAttributesFromTheme('mytheme'); | |
} | |
function getAttributesFromTheme(string $themeName) | |
{ | |
return Pipe::make( | |
$this->getTheme(...), | |
$this->getXmlFromTheme(...), | |
$this->extractAttributes(...) | |
) | |
->stopIfEmpty() | |
->from($themeName); | |
} | |
function caller() | |
{ | |
$attributes = $this->getAttributesFromTheme('mytheme')->run(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment