<commit_before><?php namespace Danmichaelo\Ncip;
/* 
 * (c) <NAME> (2013)
 * 
 * Basic Ncip library. This class currently only implements 
 * a small subset of the NCIP services.
 */

class NcipClient {

	protected $agency_id;
	protected $connector;

	/**
	 * Create a new Ncip client
	 *
	 * @param  string  $url
	 * @param  array   $options
	 * @return void
	 */
	public function __construct(NcipConnector $connector, $options = array())
	{
		$this->agency_id = array_get($options, 'agency_id', Config::get('ncip::agency_id'));
		$this->connector = $connector;
	}

	/**
	 * Lookup user information from user id
	 *
	 * @param  string  $user_id
	 * @return NcipUserResponse
	 */
	public function lookupUser($user_id)
	{
		$request = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
		<ns1:NCIPMessage xmlns:ns1="http://www.niso.org/2008/ncip" ns1:version="http://www.niso.org/schemas/ncip/v2_01/ncip_v2_01.xsd">
			<ns1:LookupUser>
				<ns1:UserId>
					<ns1:UserIdentifierValue>' . $user_id . '</ns1:UserIdentifierValue>
				</ns1:UserId>
				<ns1:LoanedItemsDesired/>
				<ns1:RequestedItemsDesired/><commit_msg>Make dependency injection of NcipConnector into NcipClient optional<commit_after><?php namespace Danmichaelo\Ncip;
/* 
 * (c) <NAME> (2013)
 * 
 * Basic Ncip library. This class currently only implements 
 * a small subset of the NCIP services.
 */

class NcipClient {

	protected $agency_id;
	protected $connector;

	/**
	 * Create a new Ncip client
	 *
	 * @param  string  $url
	 * @param  array   $options
	 * @return void
	 */
	public function __construct(NcipConnector $connector = null, $options = array())
	{
		$this->agency_id = array_get($options, 'agency_id', Config::get('ncip::agency_id'));
		$this->connector = $connector ?: new NcipConnector;
	}

	/**
	 * Lookup user information from user id
	 *
	 * @param  string  $user_id
	 * @return NcipUserResponse
	 */
	public function lookupUser($user_id)
	{
		$request = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
		<ns1:NCIPMessage xmlns:ns1="http://www.niso.org/2008/ncip" ns1:version="http://www.niso.org/schemas/ncip/v2_01/ncip_v2_01.xsd">
			<ns1:LookupUser>
				<ns1:UserId>
					<ns1:UserIdentifierValue>' . $user_id . '</ns1:UserIdentifierValue>
				</ns1:UserId>
				<ns1:LoanedItemsDesired/>
				<ns1:RequestedItemsDesired/>
{'fraction_non_alphanumeric': 0.1481958762886598, 'fraction_numerical': 0.023195876288659795, 'mean_word_length': 4.008602150537635, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 2, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 4}, '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': '347922', 'n_tokens_mistral': 912, 'n_tokens_neox': 809, 'n_words': 173}