<commit_before><?php

namespace BitWasp\Bitcoin\Mnemonic;

use BitWasp\Bitcoin\Bitcoin;
use BitWasp\Bitcoin\Crypto\EcAdapter\EcAdapterInterface;
use BitWasp\Bitcoin\Mnemonic\BIP39\Bip39Mnemonic;
use BitWasp\Bitcoin\Mnemonic\Electrum\ElectrumMnemonic;

class MnemonicFactory
{
    /**
     * @param EcAdapterInterface $ecAdapter
     * @return ElectrumMnemonic
     */
    public static function electrum(EcAdapterInterface $ecAdapter = null)
    {
        return new ElectrumMnemonic($ecAdapter ?: Bitcoin::getEcAdapter());
    }

    /**
     * @param EcAdapterInterface $ecAdapter
     * @return Bip39Mnemonic
     */
    public static function bip39(EcAdapterInterface $ecAdapter = null)
    {
        return new Bip39Mnemonic($ecAdapter ?: Bitcoin::getEcAdapter());
    }
}<commit_msg>MnemonicFactory::electrum() and bip39() should:   - accept or create it's own EcAdapter   - accept a respective WordListInterface or use the default<commit_after><?php

namespace BitWasp\Bitcoin\Mnemonic;


use BitWasp\Bitcoin\Bitcoin;
use BitWasp\Bitcoin\Crypto\EcAdapter\EcAdapterInterface;
use BitWasp\Bitcoin\Mnemonic\Bip39\Bip39Mnemonic;
use BitWasp\Bitcoin\Mnemonic\Bip39\Bip39WordListInterface;
use BitWasp\Bitcoin\Mnemonic\Electrum\ElectrumMnemonic;
use BitWasp\Bitcoin\Mnemonic\Electrum\Wordlist\ElectrumWordListInterface;

class MnemonicFactory
{

    /**
     * @param ElectrumWordListInterface $wordList
     * @param EcAdapterInterface $ecAdapter
     * @return ElectrumMnemonic
     */
    public static function electrum(ElectrumWordListInterface $wordList = null, EcAdapterInterface $ecAdapter = null)
    {
        return new ElectrumMnemonic(
            $ecAdapter ?: Bitcoin::getEcAdapter(),
            $wordList ?: new Electrum\Wordlist\EnglishWordlist()
        );
    }

    /**
     * @param \BitWasp\Bitcoin\Mnemonic\Bip39\Bip39WordListInterface $wordList
     * @param EcAdapterInterface $ecAdapter
     * @return Bip39Mnemonic
     */
    public static function bip39(Bip39WordListInterface $wordList = null, EcAdapterInterface $ecAdapter = null)
    {
        return new Bip39Mnemonic(
            $ecAdapter ?: Bitcoin::getEcAdapter(),
            $wordList ?: new Bip39\Wordlist\EnglishWordList()
        );
    }
}
{'fraction_non_alphanumeric': 0.09574944071588366, 'fraction_numerical': 0.015212527964205816, 'mean_word_length': 3.697478991596639, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4604497', 'n_tokens_mistral': 774, 'n_tokens_neox': 708, 'n_words': 127}