<commit_before><?php

/**
 * OWASP Enterprise Security API (ESAPI)
 * 
 * This file is part of the Open Web Application Security Project (OWASP)
 * Enterprise Security API (ESAPI) project. For details, please see
 * <a href="http://www.owasp.org/index.php/ESAPI">http://www.owasp.org/index.php/ESAPI</a>.
 *
 * Copyright (c) 2007 - 2009 The OWASP Foundation
 * 
 * The ESAPI is published by OWASP under the BSD license. You should read and accept the
 * LICENSE before you use, modify, and/or redistribute this software.
 * 
 * @author <NAME> (mike.boberski @ owasp.org)
 * @created 2009
 */

require_once dirname ( __FILE__ ) . '/../ESAPI.php';
require_once dirname ( __FILE__ ) . '/../Adapter.php';

class MyCompanyAdapter implements Adapter {
	
	function getValidEmployeeID($eid) {
		$val = ESAPI::getValidator();
		$val->getValidInput(			
			"My Company Employee ID", 	//context
			$eid, 						//input
			"EmployeeID", 				//type
			6, 							//max length
			false						//allow null
			);
	}
	
	function isValidEmployeeID($eid) {
		try {
			$this->getValidEmployeeID($eid);
			return true;
		} catch ( Exception $e ) {
			return false;
		}
		
	}
	
}
?><commit_msg>Updated phpdoc.<commit_after><?php

/**
 * Reference implementation of the Adapter interface. This implementation calls
 * relies on the DefaultValidator and DefaultSecurityConfiguration ESAPI for PHP Core 
 * security controls.
 * 
 * Copyright (c) 2007 - 2009 The OWASP Foundation
 *
 * The ESAPI is published by OWASP under the BSD license. You should read and accept the
 * LICENSE before you use, modify, and/or redistribute this software.
 * 
 * @author <a href="mailto:<EMAIL>?subject=ESAPI for PHP question"><NAME></a> at <a href="http://www.bah.com"><NAME></a>
 * @since Version 1.0
 */

require_once dirname ( __FILE__ ) . '/../ESAPI.php';
require_once dirname ( __FILE__ ) . '/../Adapter.php';

class MyCompanyAdapter implements Adapter {
	
	/**
	 * @inheritdoc
	 */
	function getValidEmployeeID($eid) {
		$val = ESAPI::getValidator();
		$val->getValidInput(			
			"My Company Employee ID", 	//context
			$eid, 						//input
			"EmployeeID", 				//type
			6, 							//max length
			false						//allow null
			);
	}
	
	/**
	 * @inheritdoc
	 */
	function isValidEmployeeID($eid) {
		try {
			$this->getValidEmployeeID($eid);
			return true;
		} catch ( Exception $e ) {
			return false;
		}
		
	}
	
}
?>
{'fraction_non_alphanumeric': 0.13445378151260504, 'fraction_numerical': 0.010084033613445379, 'mean_word_length': 3.015177065767285, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 3, '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': '2116557', 'n_tokens_mistral': 912, 'n_tokens_neox': 764, 'n_words': 222}