<commit_before><?php
namespace MediaWiki\Ext\UserBitcoinAddresses;

use Danwe\Bitcoin\Address;
use DateTime;
use InvalidArgumentException;
use LogicException;
use User;

/**
 * Object representing a (compressed) bitcoin addresses owned by a user together with certain
 * meta information.
 *
 *
 * @since 1.0.0
 *
 * @licence MIT License
 * @author <NAME>
 */
class UserBitcoinAddressRecord implements UserBitcoinAddress, ExtendableAsUserBitcoinAddressRecordBuilder {

	/** @var int|null */
	protected $id;

	/** @var User */
	protected $user;

	/** @var Address */
	protected $bitcoinAddress;

	/** @var DateTime|null */
	protected $addedOn;

	/** @var string|null */
	protected $addedThrough;

	/** @var DateTime|null */
	protected $exposedOn;

	/** @var string|null */
	protected $purpose;

	/**
	 * @param UserBitcoinAddressRecordBuilder $builder
	 */
	function __construct( UserBitcoinAddressRecordBuilder $builder ) {
		$this->id = $builder->getId();
		$this->user = $builder->getUser();
		$this->bitcoinAddress = $builder->getBitcoinAddress();
		$this->addedOn = $builder->getAddedOn();
		$this->addedThrough = $builder->getAddedThrough();
		$this->exposedOn = $builder->getExposedOn();
		$this->purpose = $builder->getPurpose();

		$this->validate();
	}

	protected function validate() {
		if( !( $this->user instanceof User ) ) {
			throw new InvalidArgumentException(
				'No User object set via UserBitcoinAddressBuilder::user()' );
		}
		if( !( $this->bitcoinAddress instanceof Address ) ) {
			throw new InvalidArgumentException(
				'No BitcoinAddress object set via UserBitcoinAddressBuilder::bitcoinAddress()' );
		}
		$this->consistencyCheck();
	}<commit_msg>(minor) 'public' keyword for UserBitcoinAddressRecord's constructor<commit_after><?php
namespace MediaWiki\Ext\UserBitcoinAddresses;

use Danwe\Bitcoin\Address;
use DateTime;
use InvalidArgumentException;
use LogicException;
use User;

/**
 * Object representing a (compressed) bitcoin addresses owned by a user together with certain
 * meta information.
 *
 *
 * @since 1.0.0
 *
 * @licence MIT License
 * @author <NAME>
 */
class UserBitcoinAddressRecord implements UserBitcoinAddress, ExtendableAsUserBitcoinAddressRecordBuilder {

	/** @var int|null */
	protected $id;

	/** @var User */
	protected $user;

	/** @var Address */
	protected $bitcoinAddress;

	/** @var DateTime|null */
	protected $addedOn;

	/** @var string|null */
	protected $addedThrough;

	/** @var DateTime|null */
	protected $exposedOn;

	/** @var string|null */
	protected $purpose;

	/**
	 * @param UserBitcoinAddressRecordBuilder $builder
	 */
	public function __construct( UserBitcoinAddressRecordBuilder $builder ) {
		$this->id = $builder->getId();
		$this->user = $builder->getUser();
		$this->bitcoinAddress = $builder->getBitcoinAddress();
		$this->addedOn = $builder->getAddedOn();
		$this->addedThrough = $builder->getAddedThrough();
		$this->exposedOn = $builder->getExposedOn();
		$this->purpose = $builder->getPurpose();

		$this->validate();
	}

	protected function validate() {
		if( !( $this->user instanceof User ) ) {
			throw new InvalidArgumentException(
				'No User object set via UserBitcoinAddressBuilder::user()' );
		}
		if( !( $this->bitcoinAddress instanceof Address ) ) {
			throw new InvalidArgumentException(
				'No BitcoinAddress object set via UserBitcoinAddressBuilder::bitcoinAddress()' );
		}
		$this->consistencyCheck();
	}
{'fraction_non_alphanumeric': 0.14093173161441547, 'fraction_numerical': 0.0017579841781423966, 'mean_word_length': 4.661691542288557, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 41, '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': '3808944', 'n_tokens_mistral': 1101, 'n_tokens_neox': 1005, 'n_words': 246}