<commit_before><?php
/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/zf2 for the canonical source repository
 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */

namespace Zend\Soap;

use Zend\Server\Reflection;
use Zend\Soap\AutoDiscover\DiscoveryStrategy\DiscoveryStrategyInterface as DiscoveryStrategy;
use Zend\Soap\AutoDiscover\DiscoveryStrategy\ReflectionDiscovery;
use Zend\Soap\Wsdl\ComplexTypeStrategy\ComplexTypeStrategyInterface as ComplexTypeStrategy;
use Zend\Uri;

class AutoDiscover
{
    /**
     * @var string
     */
    protected $serviceName;

    /**
     * @var Reflection
     */
    protected $reflection = null;

    /**
     * Service function names
     * @var array
     */
    protected $functions = array();

    /**
     * Service class name
     * @var string
     */
    protected $class;

    /**
     * @var bool
     */
    protected $strategy;

    /**
     * Url where the WSDL file will be available at.
     * @var WSDL Uri
     */
    protected $uri;

    /**
     * soap:body operation style options
     * @var array
     */
    protected $operationBodyStyle = array(
        'use' => 'encoded',
        'encodingStyle' => "http://schemas.xmlsoap.org/soap/encoding/"
    );

    /**
     * soap:operation style
     * @var array
     */
    protected $bindingStyle = array(
        'style' => 'rpc',
        'transport' => 'http://schemas.xmlsoap.org/soap/http'
    );

    /**
     * Name of the class to handle the WSDL creation.
     * @var string
     */
    protected $wsdlClass = 'Zend\Soap\Wsdl';

    /**
     * Class Map of PHP to WSDL types.
     * @var array
     */
    protected $classMap = array();

    /**
     * Discovery strategy for types and other method details.
     * @var DiscoveryStrategy
     */
    protected $discoveryStrategy;

    /**
     * Constructor
     *
     * @param null|ComplexTypeStrategy $strategy
     * @param null|string|Uri\Uri $endpointUri
     * @param null|string $wsdlClass
     * @param null|array $classMap
     */
    public function __construct(
        ComplexTypeStrategy $strategy = null,
        $endpointUri = null,
        $wsdlClass = null,
        array $classMap = array()
    ) {
        $this->reflection = new Reflection();
        $this->setDiscoveryStrategy(new ReflectionDiscovery());

        if (null !== $strategy) {
            $this->setComplexTypeStrategy($strategy);
        }
        if (null !== $endpointUri) {
            $this->setUri($endpointUri);
        }
        if (null !== $wsdlClass) {
            $this->setWsdlClass($wsdlClass);
        }
        $this->setClassMap($classMap);
    }

    /**
     * Set the discovery strategy for method type and other information.
     *
     * @param  DiscoveryStrategy $discoveryStrategy
     * @return self
     */
    public function setDiscoveryStrategy(DiscoveryStrategy $discoveryStrategy)
    {
        $this->discoveryStrategy = $discoveryStrategy;
        return $this;
    }

    /**
     * Get the discovery strategy.
     *
     * @return DiscoveryStrategy
     */
    public function getDiscoveryStrategy()
    {
        return $this->discoveryStrategy;
    }

    /**
     * Get the class map of php to wsdl mappings.
     *
     * @return array
     */
    public function getClassMap()
    {
        return $this->classMap;
    }

    /**
     * Set the class map of php to wsdl mappings.
     *
     * @param  array $classmap
     * @return self
     * @throws Exception\InvalidArgumentException
     */
    public function setClassMap($classMap)
    {
        if (!is_array($classMap)) {
            throw new Exception\InvalidArgumentException(sprintf(
                '%s expects an array; received "%s"',
                __METHOD__,
                (is_object($classMap) ? get_class($classMap) : gettype($classMap))
            ));
        }

        $this->classMap = $classMap;
        return $this;
    }

    /**
     * Set service name
     *
     * @param string $serviceName
     * @return self
     * @throws Exception\InvalidArgumentException<commit_msg>Update AutoDiscover.php<commit_after><?php
/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/zf2 for the canonical source repository
 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */

namespace Zend\Soap;

use Zend\Server\Reflection;
use Zend\Soap\AutoDiscover\DiscoveryStrategy\DiscoveryStrategyInterface as DiscoveryStrategy;
use Zend\Soap\AutoDiscover\DiscoveryStrategy\ReflectionDiscovery;
use Zend\Soap\Wsdl\ComplexTypeStrategy\ComplexTypeStrategyInterface as ComplexTypeStrategy;
use Zend\Uri;

class AutoDiscover
{
    /**
     * @var string
     */
    protected $serviceName;

    /**
     * @var Reflection
     */
    protected $reflection = null;

    /**
     * Service function names
     * @var array
     */
    protected $functions = array();

    /**
     * Service class name
     * @var string
     */
    protected $class;

    /**
     * @var bool
     */
    protected $strategy;

    /**
     * Url where the WSDL file will be available at.
     * @var WSDL Uri
     */
    protected $uri;

    /**
     * soap:body operation style options
     * @var array
     */
    protected $operationBodyStyle = array(
        'use' => 'encoded',
        'encodingStyle' => "http://schemas.xmlsoap.org/soap/encoding/"
    );

    /**
     * soap:operation style
     * @var array
     */
    protected $bindingStyle = array(
        'style' => 'rpc',
        'transport' => 'http://schemas.xmlsoap.org/soap/http'
    );

    /**
     * Name of the class to handle the WSDL creation.
     * @var string
     */
    protected $wsdlClass = 'Zend\Soap\Wsdl';

    /**
     * Class Map of PHP to WSDL types.
     * @var array
     */
    protected $classMap = array();

    /**
     * Discovery strategy for types and other method details.
     * @var DiscoveryStrategy
     */
    protected $discoveryStrategy;

    /**
     * Constructor
     *
     * @param null|ComplexTypeStrategy $strategy
     * @param null|string|Uri\Uri $endpointUri
     * @param null|string $wsdlClass
     * @param null|array $classMap
     */
    public function __construct(
        ComplexTypeStrategy $strategy = null,
        $endpointUri = null,
        $wsdlClass = null,
        array $classMap = array()
    ) {
        $this->reflection = new Reflection();
        $this->setDiscoveryStrategy(new ReflectionDiscovery());

        if (null !== $strategy) {
            $this->setComplexTypeStrategy($strategy);
        }
        if (null !== $endpointUri) {
            $this->setUri($endpointUri);
        }
        if (null !== $wsdlClass) {
            $this->setWsdlClass($wsdlClass);
        }
        $this->setClassMap($classMap);
    }

    /**
     * Set the discovery strategy for method type and other information.
     *
     * @param  DiscoveryStrategy $discoveryStrategy
     * @return self
     */
    public function setDiscoveryStrategy(DiscoveryStrategy $discoveryStrategy)
    {
        $this->discoveryStrategy = $discoveryStrategy;
        return $this;
    }

    /**
     * Get the discovery strategy.
     *
     * @return DiscoveryStrategy
     */
    public function getDiscoveryStrategy()
    {
        return $this->discoveryStrategy;
    }

    /**
     * Get the class map of php to wsdl mappings.
     *
     * @return array
     */
    public function getClassMap()
    {
        return $this->classMap;
    }

    /**
     * Set the class map of php to wsdl mappings.
     *
     * @param  array $classMap
     * @return self
     * @throws Exception\InvalidArgumentException
     */
    public function setClassMap($classMap)
    {
        if (!is_array($classMap)) {
            throw new Exception\InvalidArgumentException(sprintf(
                '%s expects an array; received "%s"',
                __METHOD__,
                (is_object($classMap) ? get_class($classMap) : gettype($classMap))
            ));
        }

        $this->classMap = $classMap;
        return $this;
    }

    /**
     * Set service name
     *
     * @param string $serviceName
     * @return self
     * @throws Exception\InvalidArgumentException
{'fraction_non_alphanumeric': 0.11733364906464598, 'fraction_numerical': 0.002131186360407293, 'mean_word_length': 2.1066568591393895, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1030495', 'n_tokens_mistral': 2518, 'n_tokens_neox': 2379, 'n_words': 578}