From b679783fb834f6736c2edc415cf40056150cdcdf Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 1 Mar 2023 11:23:48 +0100 Subject: [PATCH] Add App::keys() method --- src/App.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/App.php b/src/App.php index 19a043a..0116083 100644 --- a/src/App.php +++ b/src/App.php @@ -150,6 +150,18 @@ class App { ); } + /** + * Get list of keys of a specific option + * + * @param string $key The configuration variable key + * + * @return array An array of the keys of a specific option + **/ + public static function keys($key) { + $value = self :: get($key); + return (is_array($value)?array_keys($value):array()); + } + /** * Set a specific option value *