Cascade\Config\Loader\FileLoader\FileLoaderAbstract::getSectionOf PHP Method

getSectionOf() public method

Return a section of an array based on the key passed in
public getSectionOf ( array $array, string $section = '' ) : array | mixed
$array array Array we want the section from
$section string Section name (key)
return array | mixed Return the section of an array or just a value
    public function getSectionOf($array, $section = '')
    {
        if (!empty($section) && array_key_exists($section, $array)) {
            return $array[$section];
        }
        return $array;
    }