<commit_before><?php
/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to <EMAIL> so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_Service
 * @subpackage LiveDocx
 * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */

/**
 * @namespace
 */
namespace Zend\Service\LiveDocx;


/**
 * @uses       \Zend\Config\Config
 * @category   Zend
 * @package    Zend_Service
 * @subpackage LiveDocx
 * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
abstract class AbstractLiveDocx
{
    /**
     * LiveDocx service version.
     * @since LiveDocx 1.0
     */
    const VERSION = '2.0';


    /**
     * SOAP client used to connect to LiveDocx service.
     * @var   \Zend\Soap\Client
     * @since LiveDocx 1.0
     */
    protected $_soapClient = null;

    /**
     * WSDL of LiveDocx service.
     * @var   string
     * @since LiveDocx 1.0
     */
    protected $_wsdl = null;

    /**
     * Array of credentials (username and password) to log into LiveDocx service.
     * @var   array
     * @since LiveDocx 1.2
     */
    protected $_credentials = array();

    /**
     * Status of connection to LiveDocx service.
     * When set to true, session is logged into LiveDocx service.
     * When set to false, session is not logged into LiveDocx service.
     * @var   boolean
     * @since LiveDocx 1.2
     */
    protected $_isLoggedIn = null;


    /**
     * Constructor.
     *
     * Optionally, pass an array of options (or \Zend\Config\Config object).
     *
     * @param  array | \Zend\Config\Config $options
     * @return void
     * @since  LiveDocx 1.0
     */
    public function __construct($options = null)
    {
        $this->_setIsLoggedIn(false);

        if ($options instanceof \Zend\Config\Config) {
            $options = $options->toArray();
        }

        if (is_array($options)) {
            $this->setOptions($options);
        }
    }

    /**
     * Clean up and log out of LiveDocx service.
     *
     * @return boolean
     * @since  LiveDocx 1.0
     */
    public function __destruct()
    {
        return $this->_logOut();
    }

    /**
     * Set options
     * One or more of username, password or soapClient.
     * 
     * @param  $options
     * @throws \Zend\Service\LiveDocx\Exception\InvalidArgumentException
     * @return \Zend\Service\AbstractLiveDocx
     * @since  LiveDocx 1.2<commit_msg>Slight documentation update<commit_after><?php
/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to <EMAIL> so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_Service
 * @subpackage LiveDocx
 * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */

/**
 * @namespace
 */
namespace Zend\Service\LiveDocx;


/**
 * @uses       \Zend\Config\Config
 * @category   Zend
 * @package    Zend_Service
 * @subpackage LiveDocx
 * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
abstract class AbstractLiveDocx
{
    /**
     * LiveDocx service version.
     * @since LiveDocx 1.0
     */
    const VERSION = '2.0';


    /**
     * SOAP client used to connect to LiveDocx service.
     * @var   \Zend\Soap\Client
     * @since LiveDocx 1.0
     */
    protected $_soapClient = null;

    /**
     * WSDL of LiveDocx service.
     * @var   string
     * @since LiveDocx 1.0
     */
    protected $_wsdl = null;

    /**
     * Array of credentials (username and password) to log into LiveDocx service.
     * @var   array
     * @since LiveDocx 1.2
     */
    protected $_credentials = array();

    /**
     * Status of connection to LiveDocx service.
     * When set to true, session is logged into LiveDocx service.
     * When set to false, session is not logged into LiveDocx service.
     * @var   boolean
     * @since LiveDocx 1.2
     */
    protected $_isLoggedIn = null;


    /**
     * Constructor.
     *
     * Optionally, pass an array of options (or \Zend\Config\Config object).
     *
     * @param  array | \Zend\Config\Config $options
     * @return void
     * @since  LiveDocx 1.0
     */
    public function __construct($options = null)
    {
        $this->_setIsLoggedIn(false);

        if ($options instanceof \Zend\Config\Config) {
            $options = $options->toArray();
        }

        if (is_array($options)) {
            $this->setOptions($options);
        }
    }

    /**
     * Clean up and log out of LiveDocx service.
     *
     * @return boolean
     * @since  LiveDocx 1.0
     */
    public function __destruct()
    {
        return $this->_logOut();
    }

    /**
     * Set options. Valid options are username, password and soapClient.
     * 
     * @param  $options
     * @throws \Zend\Service\LiveDocx\Exception\InvalidArgumentException
     * @return \Zend\Service\AbstractLiveDocx
     * @since  LiveDocx 1.2
{'fraction_non_alphanumeric': 0.11088573360378634, 'fraction_numerical': 0.011494252873563218, 'mean_word_length': 2.21401412275937, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '2268581', 'n_tokens_mistral': 1895, 'n_tokens_neox': 1798, 'n_words': 554}