<commit_before><?php

namespace Com\NgAbq\Beta;
require_once("autoload.php");

/**
 * PHP representation of an OAuth identity.
 *
 * The OAuth identity is information about where a user logged in from.
 *
 * @author <NAME> <<EMAIL>> and <NAME> <<EMAIL>>
 *
 * @version 1.0.0
 **/
class OauthIdentitiy implements \JsonSerializable {

	/* STATE VARIABLES */

	/**
	 * Primary key of oauthIdentity
	 * @var int $oauthIdentityId
	 **/
	private $oauthIdentityId;

	/**
	 * OauthIdentity profile id
	 * @var int $oauthIdentityProfileId
	 **/
	private $oauthIdentityProfileId;

	/**
	 * OauthIdentity provider id
	 * @var string $oauthIdentityProviderId
	 **/
	private $oauthIdentityProviderId;

	/**
	 * OauthIdentity provider
	 * @var string $oauthIdentityProvider
	 **/
	private $oauthIdentityProvider;

	/**
	 * OauthIdentityAccessToken
	 * @var string $oauthIdentityAccessToken
	 **/
	private $oauthIdentityAccessToken;

	/**
	 * OauthIdentity time stamp
	 * @var \DateTime $oauthIdentityTimeStamp
	 **/
	private $oauthIdentityTimeStamp;

	/* CONSTRUCTOR */

	/**
	 * Constructor for oauthIdentity
	 *
	 * @param int|null $newOauthIdentityId, primary key, null if new oauthIdentity
	 * @param int $newOauthIdentityProfileId, profile id of authorized access
	 * @param string $newOauthIdentityProviderId, id of provider
	 * @param string $newOauthIdentityProvider, name of provider of authorization
	 * @param string $newOauthIdentityAccessToken, token from provider
	 * @param \DateTime|string|null $newOauthIdentityTimeStamp, time of authorization or null if set to current date and time
	 * @throws \InvalidArgumentException if argument does not cooperate
	 * @throws \RangeException if argument is out of bounds
	 * @throws \TypeError if type is invalid
	 * @throws \Exception to handle edge cases
	 **/
	public function __construct(int $newOauthIdentityId = null, int $newOauthIdentityProfileId, string $newOauthIdentityProviderId, string $newOauthIdentityProvider, string $newOauthIdentityAccessToken, $newOauthIdentityTimeStamp = null) {
		try {
			$this->setOauthIdentityId($newOauthIdentityId);
			$this->setOauthIdentityProfileId($newOauthIdentityProfileId);
			$this->setOauthIdentityProviderId($newOauthIdentityProviderId);
			$this->setOauthIdentityProvider($newOauthIdentityProvider);
			$this->setOauthIdentityAccessToken($newOauthIdentityAccessToken);
			$this->setOauthIdentityTimeStam($newOauthIdentityTimeStamp);
		} catch(\InvalidArgumentException $invalidArgument) {
			// Rethrow the exception
			throw(new \InvalidArgumentException($invalidArgument->getMessage(), 0, $invalidArgument));
		} catch(\RangeException $range) {
			// Rethrow the exception
			throw(new \RangeException($range->getMessage(), 0, $range));
		} catch(\TypeError $typeError) {
			// Rethrow the exception
			throw(new \TypeError($typeError->getMessage(), 0, $typeError));
		} catch(\Exception $exception) {
			// Rethrow the exception
			throw new \Exception($exception->getMessage(), 0, $exception);
		}
	}

	/* ACCESSORS AND MUTATORS */

	/**
	 * Accessor for oauthIdentity ID
	 * @return int|null primary key
	 **/
	public function getoauthIdentityId() {
		return $this->oauthIdentityId;
	}

	/**
	 * Mutator for oauthIdentity ID
	 * @param int|null $newOauthIdentityId, primary key
	 * @throws \RangeException if oauthIdentity ID is not > 0
	 * @throws \TypeError if oauthIdentity ID is not an integer
	 **/
	public function setOauthIdentityId(int $newOauthIdentityId = null) {
		// Let oauthIdentity ID = null
		if ($newOauthIdentityId === null) {
			$this->oauthIdentityId = null;
			return;
		}

		// Make sure oauthIdentity ID > 0
		if ($newOauthIdentityId <= 0) {
			throw new \RangeException("OauthIdentity ID must be positive");
		}

		$this->oauthIdentityId = $newOauthIdentityId;
	}

	/**
	 * accessor method for oauthIdentity profile id
	 *
	 * @return int value of oauthIdentity profile id
	 */

	public function getOauthIdentityProfileId() {
		return ($this->oauthIdentityProfileId);
	}

	/**
	 * mutator method for oauthIdentity id
	 *
	 * @param int|null $newOauthIdentityProfileId new value of oauthIdentity profile id
	 * @throws \RangeException if $newOauthIdentityProfileId is not positive
	 * @throws \TypeError if $newOauthIdentityProfileId is not an integer
	 */
	public function setOauthIdentityProfileId(int $newOauthIdentityProfileId) {
		// verify the oauthIdentityProfileId is positive
		if($newOauthIdentityProfileId <= 0) {
			throw(new \RangeException("oauthIdentityProfileId is not positive"));
		}

		// convert and store the account id
		$this->oauthIdentityProfileId = $newOauthIdentityProfileId;
	}

	/**
	 * accessor method for oauthIdentity provider id
	 *
	 * @return string value of oauthIdentity provider id
	 */
	public function getOauthIdentityProviderId() {
		return ($this->oauthIdentityProviderId);
	}

	/**
	 * mutator method for oauthIdentity provider id
	 *
	 * @param string $newOauthIdentityProviderId new value of oauthIdentity provider id
	 * @throws \InvalidArgumentException if $newOauthIdentityProviderId is not a string or insecure
	 * @throws \RangeException if $newOauthIdentityProviderId is > 28 characters
	 * @throws \TypeError if $newOauthIdentityProviderId is not a string
	 */
	public function setOauthIdentityProviderId(string $newOauthIdentityProviderId) {
		// verify the oauthIdentity provider id is secure
		$newOauthIdentityProviderId = trim($newOauthIdentityProviderId);
		$newOauthIdentityProviderId = filter_var($newOauthIdentityProviderId, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES);
		if(empty($newOauthIdentityProviderId) === true) {
			throw(new \InvalidArgumentException("oauthIdentity provider id is empty or insecure"));
		}

		// verify the oauthIdentity provider id will fit in the database
		if(strlen($newOauthIdentityProviderId) > 28) {
			throw(new \RangeException("oauthIdentity provider id is too long"));
		}

		// store the product description
		$this->oauthIdentityProviderId = $newOauthIdentityProviderId;
	}

	//TODO
	public function jsonSerialize() {
		// TODO
	}
}<commit_msg>working on getters/setters for various classes<commit_after><?php

namespace Com\NgAbq\Beta;
require_once("autoload.php");

/**
 * PHP representation of an OAuth identity.
 *
 * The OAuth identity is information about where a user logged in from.
 *
 * @author <NAME> <<EMAIL>> and <NAME> <<EMAIL>>
 *
 * @version 1.0.0
 **/
class OauthIdentitiy implements \JsonSerializable {

	/* STATE VARIABLES */

	/**
	 * Primary key of oauthIdentity
	 * @var int $oauthIdentityId
	 **/
	private $oauthIdentityId;

	/**
	 * OauthIdentity profile id
	 * @var int $oauthIdentityProfileId
	 **/
	private $oauthIdentityProfileId;

	/**
	 * OauthIdentity provider id
	 * @var string $oauthIdentityProviderId
	 **/
	private $oauthIdentityProviderId;

	/**
	 * OauthIdentity provider
	 * @var string $oauthIdentityProvider
	 **/
	private $oauthIdentityProvider;

	/**
	 * OauthIdentityAccessToken
	 * @var string $oauthIdentityAccessToken
	 **/
	private $oauthIdentityAccessToken;

	/**
	 * OauthIdentity time stamp
	 * @var \DateTime $oauthIdentityTimeStamp
	 **/
	private $oauthIdentityTimeStamp;

	/* CONSTRUCTOR */

	/**
	 * Constructor for oauthIdentity
	 *
	 * @param int|null $newOauthIdentityId , primary key, null if new oauthIdentity
	 * @param int $newOauthIdentityProfileId , profile id of authorized access
	 * @param string $newOauthIdentityProviderId , id of provider
	 * @param string $newOauthIdentityProvider , name of provider of authorization
	 * @param string $newOauthIdentityAccessToken , token from provider
	 * @param \DateTime|string|null $newOauthIdentityTimeStamp , time of authorization or null if set to current date and time
	 * @throws \InvalidArgumentException if argument does not cooperate
	 * @throws \RangeException if argument is out of bounds
	 * @throws \TypeError if type is invalid
	 * @throws \Exception to handle edge cases
	 **/
	public function __construct(int $newOauthIdentityId = null, int $newOauthIdentityProfileId, string $newOauthIdentityProviderId, string $newOauthIdentityProvider, string $newOauthIdentityAccessToken, $newOauthIdentityTimeStamp = null) {
		try {
			$this->setOauthIdentityId($newOauthIdentityId);
			$this->setOauthIdentityProfileId($newOauthIdentityProfileId);
			$this->setOauthIdentityProviderId($newOauthIdentityProviderId);
			$this->setOauthIdentityProvider($newOauthIdentityProvider);
			$this->setOauthIdentityAccessToken($newOauthIdentityAccessToken);
			$this->setOauthIdentityTimeStam($newOauthIdentityTimeStamp);
		} catch(\InvalidArgumentException $invalidArgument) {
			// Rethrow the exception
			throw(new \InvalidArgumentException($invalidArgument->getMessage(), 0, $invalidArgument));
		} catch(\RangeException $range) {
			// Rethrow the exception
			throw(new \RangeException($range->getMessage(), 0, $range));
		} catch(\TypeError $typeError) {
			// Rethrow the exception
			throw(new \TypeError($typeError->getMessage(), 0, $typeError));
		} catch(\Exception $exception) {
			// Rethrow the exception
			throw new \Exception($exception->getMessage(), 0, $exception);
		}
	}

	/* ACCESSORS AND MUTATORS */

	/**
	 * Accessor for oauthIdentity ID
	 * @return int|null primary key
	 **/
	public function getoauthIdentityId() {
		return $this->oauthIdentityId;
	}

	/**
	 * Mutator for oauthIdentity ID
	 * @param int|null $newOauthIdentityId , primary key
	 * @throws \RangeException if oauthIdentity ID is not > 0
	 * @throws \TypeError if oauthIdentity ID is not an integer
	 **/
	public function setOauthIdentityId(int $newOauthIdentityId = null) {
		// Let oauthIdentity ID = null
		if($newOauthIdentityId === null) {
			$this->oauthIdentityId = null;
			return;
		}

		// Make sure oauthIdentity ID > 0
		if($newOauthIdentityId <= 0) {
			throw new \RangeException("OauthIdentity ID must be positive");
		}

		$this->oauthIdentityId = $newOauthIdentityId;
	}

	/**
	 * accessor method for oauthIdentity profile id
	 *
	 * @return int value of oauthIdentity profile id
	 */

	public function getOauthIdentityProfileId() {
		return ($this->oauthIdentityProfileId);
	}

	/**
	 * mutator method for oauthIdentity id
	 *
	 * @param int|null $newOauthIdentityProfileId new value of oauthIdentity profile id
	 * @throws \RangeException if $newOauthIdentityProfileId is not positive
	 * @throws \TypeError if $newOauthIdentityProfileId is not an integer
	 */
	public function setOauthIdentityProfileId(int $newOauthIdentityProfileId) {
		// verify the oauthIdentityProfileId is positive
		if($newOauthIdentityProfileId <= 0) {
			throw(new \RangeException("oauthIdentityProfileId is not positive"));
		}

		// convert and store the account id
		$this->oauthIdentityProfileId = $newOauthIdentityProfileId;
	}

	/**
	 * accessor method for oauthIdentity provider id
	 *
	 * @return string value of oauthIdentity provider id
	 */
	public function getOauthIdentityProviderId() {
		return ($this->oauthIdentityProviderId);
	}

	/**
	 * mutator method for oauthIdentity provider id
	 *
	 * @param string $newOauthIdentityProviderId new value of oauthIdentity provider id
	 * @throws \InvalidArgumentException if $newOauthIdentityProviderId is not a string or insecure
	 * @throws \RangeException if $newOauthIdentityProviderId is > 28 characters
	 * @throws \TypeError if $newOauthIdentityProviderId is not a string
	 */
	public function setOauthIdentityProviderId(string $newOauthIdentityProviderId) {
		// verify the oauthIdentity provider id is secure
		$newOauthIdentityProviderId = trim($newOauthIdentityProviderId);
		$newOauthIdentityProviderId = filter_var($newOauthIdentityProviderId, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES);
		if(empty($newOauthIdentityProviderId) === true) {
			throw(new \InvalidArgumentException("oauthIdentity provider id is empty or insecure"));
		}

		// verify the oauthIdentity provider id will fit in the database
		if(strlen($newOauthIdentityProviderId) > 28) {
			throw(new \RangeException("oauthIdentity provider id is too long"));
		}

		// store the product description
		$this->oauthIdentityProviderId = $newOauthIdentityProviderId;
	}

	/**
	 * accessor method for oauthIdentity provider id
	 *
	 * @return string value of oauthIdentity provider id
	 */
	public function getOauthIdentityProviderId() {
		return ($this->oauthIdentityProviderId);
	}

	/**
	 * mutator method for oauthIdentity provider id
	 *
	 * @param string $newOauthIdentityProviderId new value of oauthIdentity provider id
	 * @throws \InvalidArgumentException if $newOauthIdentityProviderId is not a string or insecure
	 * @throws \RangeException if $newOauthIdentityProviderId is > 28 characters
	 * @throws \TypeError if $newOauthIdentityProviderId is not a string
	 */
	public function setOauthIdentityProviderId(string $newOauthIdentityProviderId) {
		// verify the oauthIdentity provider id is secure
		$newOauthIdentityProviderId = trim($newOauthIdentityProviderId);
		$newOauthIdentityProviderId = filter_var($newOauthIdentityProviderId, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES);
		if(empty($newOauthIdentityProviderId) === true) {
			throw(new \InvalidArgumentException("oauthIdentity provider id is empty or insecure"));
		}

		// verify the oauthIdentity provider id will fit in the database
		if(strlen($newOauthIdentityProviderId) > 28) {
			throw(new \RangeException("oauthIdentity provider id is too long"));
		}

		// store the product description
		$this->oauthIdentityProviderId = $newOauthIdentityProviderId;
	}

	//TODO
	public function jsonSerialize() {
		// TODO
	}
}
{'fraction_non_alphanumeric': 0.09549071618037135, 'fraction_numerical': 0.0025051576775714708, 'mean_word_length': 4.753709198813056, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 61, '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': '811673', 'n_tokens_mistral': 4241, 'n_tokens_neox': 3849, 'n_words': 1081}