src/Validation/Validator.php
public function inModuleList(string $item, string $moduleName, string $listName)
    {
        try {
            $items = (new ModuleConfig(ConfigType::LISTS(), $moduleName, $listName))->parseToArray();
        } catch (InvalidArgumentException $e) {
            return $e->getMessage();
        }

        /** @var mixed[]|null $config */
        $inactive = $items['items'][$item]['inactive'] ?? null;
        if ($inactive === null || $inactive === true) {
            return (string)__('Invalid list item: `{0}`', $item);
        }

        return true;
    }
public function inModuleList(string $item, string $moduleName, string $listName)
    {
        try {
            $items = (new ModuleConfig(ConfigType::LISTS(), $moduleName, $listName))->parseToArray();
        } catch (InvalidArgumentException $e) {
            return $e->getMessage();
        }

        /** @var mixed[]|null $config */
        $inactive = $items['items'][$item]['inactive'] ?? null;
        if ($inactive === null || $inactive === true) {
            return (string)__('Invalid list item: `{0}`', $item);
        }

        return true;
    }
public function inModuleList ( string $ item , string $ moduleName , string $ listName ) { try { $ items = ( new ModuleConfig ( ConfigType :: LISTS ( ) , $ moduleName , $ listName ) ) -> parseToArray ( ) ; } catch ( InvalidArgumentException $ e ) { return $ e -> getMessage ( ) ; } /** @var mixed[]|null $config */ $ inactive = $ items [ 'items' ] [ $ item ] [ 'inactive' ] ?? null ; if ( $ inactive === null || $ inactive === true ) { return ( string ) __ ( 'Invalid list item: `{0}`' , $ item ) ; } return true ; }
Returns true if the passed list item is valid and enabled.

@param string $item List item.
@param string $moduleName Module name.
@param string $listName List name.
@return string|true True if list item is enabled, error string otherwise.
Returns true if the passed list item is valid and enabled .