public static function getMode(string $mode): array
    {
        $options = [
            "shuffle"   =>  false,
            "repeat"    =>  false,
        ];

        if (in_array($mode, ["REPEAT_ALL", "SHUFFLE"])) {
            $options["repeat"] = true;
        }
        if (in_array($mode, ["SHUFFLE_NOREPEAT", "SHUFFLE"])) {
            $options["shuffle"] = true;
        }

        return $options;
    }
public static function getMode(string $mode): array
    {
        $options = [
            "shuffle"   =>  false,
            "repeat"    =>  false,
        ];

        if (in_array($mode, ["REPEAT_ALL", "SHUFFLE"])) {
            $options["repeat"] = true;
        }
        if (in_array($mode, ["SHUFFLE_NOREPEAT", "SHUFFLE"])) {
            $options["shuffle"] = true;
        }

        return $options;
    }
public static function getMode ( string $ mode ) : array { $ options = [ "shuffle" => false , "repeat" => false , ] ; if ( in_array ( $ mode , [ "REPEAT_ALL" , "SHUFFLE" ] ) ) { $ options [ "repeat" ] = true ; } if ( in_array ( $ mode , [ "SHUFFLE_NOREPEAT" , "SHUFFLE" ] ) ) { $ options [ "shuffle" ] = true ; } return $ options ; }
Create a mode array from the mode text value.

@param string $mode

@return array Mode data containing the following boolean elements (shuffle, repeat)
Create a mode array from the mode text value .