src/Utility/Validate/Utility.php
public static function isValidList(string $list, string $module = '') : bool
    {
        if (strpos($list, '.') !== false) {
            list($module, $list) = explode('.', $list, 2);
        }

        $listItems = null;
        try {
            $mc = new ModuleConfig(ConfigType::LISTS(), $module, $list, ['cacheSkip' => true]);
            $config = $mc->parse();
            $listItems = property_exists($config, 'items') ? $config->items : null;
        } catch (InvalidArgumentException $e) {
            return false;
        }

        if (null === $listItems) {
            return false;
        }

        return true;
    }
public static function isValidList(string $list, string $module = '') : bool
    {
        if (strpos($list, '.') !== false) {
            list($module, $list) = explode('.', $list, 2);
        }

        $listItems = null;
        try {
            $mc = new ModuleConfig(ConfigType::LISTS(), $module, $list, ['cacheSkip' => true]);
            $config = $mc->parse();
            $listItems = property_exists($config, 'items') ? $config->items : null;
        } catch (InvalidArgumentException $e) {
            return false;
        }

        if (null === $listItems) {
            return false;
        }

        return true;
    }
public static function isValidList ( string $ list , string $ module = '' ) : bool { if ( strpos ( $ list , '.' ) !== false ) { list ( $ module , $ list ) = explode ( '.' , $ list , 2 ) ; } $ listItems = null ; try { $ mc = new ModuleConfig ( ConfigType :: LISTS ( ) , $ module , $ list , [ 'cacheSkip' => true ] ) ; $ config = $ mc -> parse ( ) ; $ listItems = property_exists ( $ config , 'items' ) ? $ config -> items : null ; } catch ( InvalidArgumentException $ e ) { return false ; } if ( null === $ listItems ) { return false ; } return true ; }
Check if the given list is valid

Lists with no items are assumed to be invalid.

@param string $list List name to check
@param string $module Module name to check the list in
@return bool True if valid, false otherwise
Check if the given list is valid