<commit_before><?php

namespace BitWasp\Bitcoin\Transaction;

use BitWasp\Bitcoin\Bitcoin;
use BitWasp\Buffertools\Parser;
use BitWasp\Bitcoin\Serializer\Transaction\TransactionSerializer;

class TransactionFactory
{
    /**
     * @return TransactionSerializer
     */
    public static function getSerializer()
    {
        $serializer = new TransactionSerializer;
        return $serializer;
    }

    /**
     * @param int|null $version
     * @param TransactionInputCollection|null $inputs
     * @param TransactionOutputCollection|null $outputs
     * @return Transaction
     */
    public static function create(
        $version = null,
        TransactionInputCollection $inputs = null,
        TransactionOutputCollection $outputs = null
    ) {
        $transaction = new Transaction($version, $inputs, $outputs);
        return $transaction;
    }

    /**
     * @param TransactionInterface $tx
     * @return TransactionBuilder
     */<commit_msg>Allow TransactionFactory::create() $version argument to be null, and change it to the default whenever this is the case. People may wish only to pass inputs/output.<commit_after><?php

namespace BitWasp\Bitcoin\Transaction;

use BitWasp\Bitcoin\Bitcoin;
use BitWasp\Buffertools\Parser;
use BitWasp\Bitcoin\Serializer\Transaction\TransactionSerializer;

class TransactionFactory
{
    /**
     * @return TransactionSerializer
     */
    public static function getSerializer()
    {
        $serializer = new TransactionSerializer;
        return $serializer;
    }

    /**
     * @param int|null $version
     * @param TransactionInputCollection|null $inputs
     * @param TransactionOutputCollection|null $outputs
     * @return Transaction
     */
    public static function create(
        $version = null,
        TransactionInputCollection $inputs = null,
        TransactionOutputCollection $outputs = null
    ) {
        if (null === $version) {
            $version = TransactionInterface::DEFAULT_VERSION;
        }

        $transaction = new Transaction($version, $inputs, $outputs);
        return $transaction;
    }

    /**
     * @param TransactionInterface $tx
     * @return TransactionBuilder
     */
{'fraction_non_alphanumeric': 0.09153318077803203, 'fraction_numerical': 0.0, 'mean_word_length': 2.960144927536232, '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': '245502', 'n_tokens_mistral': 548, 'n_tokens_neox': 546, 'n_words': 143}