<commit_before><?php

namespace Edu\Cnm\aaaa\DataDesign;

class Swipe {

	private $swipeId;
	private $swipeNumber;
	private $swipeStatus;

	public function __construct(int $newSwipeId, int $newSwipeNumber, int $newSwipeStatus){
		$this->setSwipeId($newSwipeId);
		$this->setSwipeNumber($newSwipeNumber);
		$this->setSwipeStatus($newSwipeStatus);
	}

	public function getSwipeId(){
		return($this->swipeId);
	}

	public function getSwipeNumber(){
		return($this->swipeNumber);
	}

	public function getSwipeStatus(){
		return($this->swipeStatus);
	}

	public function setSwipeId(int $newSwipeId){
		$this->swipeId = $newSwipeId;
	}

	public function setSwipeNumber(int $newSwipeNumber){
		$this->swipeNumber = $newSwipeNumber;
	}

	public function setSwipeStatus(int $newSwipeStatus){
		$this->swipeStatus = $newSwipeStatus;
	}
}<commit_msg>added input validation to Swipe class<commit_after><?php

namespace Edu\Cnm\aaaa\DataDesign;

class Swipe {

	private $swipeId;
	private $swipeNumber;
	private $swipeStatus;

	public function __construct(int $newSwipeId, int $newSwipeNumber, int $newSwipeStatus){
		try {
			$this->setSwipeId($newSwipeId);
			$this->setSwipeNumber($newSwipeNumber);
			$this->setSwipeStatus($newSwipeStatus);
		}catch(\InvalidArgumentException $invalidArgumentException){
			// rethrow exception to the caller
			throw(new \InvalidArgumentException($invalidArgumentException->getMessage(),0,$invalidArgumentException));
		} catch(\RangeException $rangeException){
			// rethrow exception to the caller
			throw(new \RangeException($rangeException->getMessage(),0,$rangeException));
		} catch(\TypeError $typeError){
			// rethrow exception to the caller
			throw(new \TypeError($typeError->getMessage(),0,$typeError));
		} catch(\Exception $exception){
			// rethrow exception to the caller
			throw(new \Exception($exception->getMessage(),0,$exception));
		}
	}

	public function getSwipeId(){
		return($this->swipeId);
	}

	public function getSwipeNumber(){
		return($this->swipeNumber);
	}

	public function getSwipeStatus(){
		return($this->swipeStatus);
	}

	public function setSwipeId(int $newSwipeId){
		// verify that newSwipeId is positive
		if($newSwipeId <= 0){
			throw new \RangeException("swipe id is not positive");
		}
		$this->swipeId = $newSwipeId;
	}

	public function setSwipeNumber(int $newSwipeNumber){
		// verify that newSwipeNumber is positive
		if($newSwipeNumber <= 0){
			throw new \RangeException("swipe number is not positive");
		}
		$this->swipeNumber = $newSwipeNumber;
	}

	public function setSwipeStatus(int $newSwipeStatus){
		// verify that newSwipeStatus is positive
		if($newSwipeStatus <= 0){
			throw new \RangeException("swipe status is not positive");
		}
		$this->swipeStatus = $newSwipeStatus;
	}
}
{'fraction_non_alphanumeric': 0.12834417932031814, 'fraction_numerical': 0.0025307302964569776, 'mean_word_length': 5.3173515981735155, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 25, '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': '2249605', 'n_tokens_mistral': 963, 'n_tokens_neox': 885, 'n_words': 188}