X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fconsolidation%2Fconfig%2Fsrc%2FUtil%2FConfigGroup.php;fp=vendor%2Fconsolidation%2Fconfig%2Fsrc%2FUtil%2FConfigGroup.php;h=24b29dd8ec88e4ed76bc975de89525dc6b8b2a67;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/consolidation/config/src/Util/ConfigGroup.php b/vendor/consolidation/config/src/Util/ConfigGroup.php new file mode 100644 index 000000000..24b29dd8e --- /dev/null +++ b/vendor/consolidation/config/src/Util/ConfigGroup.php @@ -0,0 +1,61 @@ +config = $config; + $this->group = $group; + $this->prefix = $prefix; + $this->postfix = $postfix; + } + + /** + * Return a description of the configuration group (with prefix and postfix). + */ + public function describe($property) + { + return $this->prefix . $this->group . $this->postfix . $property; + } + + /** + * Get the requested configuration key from the most specific configuration + * group that contains it. + */ + abstract public function get($key); + + /** + * Given a group name, such as "foo.bar.baz", return the next configuration + * group in the fallback hierarchy, e.g. "foo.bar". + */ + protected function moreGeneralGroupName($group) + { + $result = preg_replace('#\.[^.]*$#', '', $group); + if ($result != $group) { + return $result; + } + return false; + } +}