<commit_before><?php

namespace PhpPact\Standalone\MockService;

use PhpPact\Standalone\Exception\MissingEnvVariableException;

/**
 * An environment variable based mock server configuration.
 * Class MockServerEnvConfig.
 */
class MockServerEnvConfig extends MockServerConfig
{
    const DEFAULT_SPECIFICATION_VERSION = '2.0.0';

    /**
     * MockServerEnvConfig constructor.
     *
     * @throws MissingEnvVariableException
     */
    public function __construct()
    {
        $this
            ->setHost($this->parseEnv('PACT_MOCK_SERVER_HOST'))
            ->setPort($this->parseEnv('PACT_MOCK_SERVER_PORT'))
            ->setConsumer($this->parseEnv('PACT_CONSUMER_NAME'))
            ->setProvider($this->parseEnv('PACT_PROVIDER_NAME'))
            ->setPactDir($this->parseEnv('PACT_OUTPUT_DIR', false))
            ->setCors($this->parseEnv('PACT_CORS', false));

        $timeout = $this->parseEnv('PACT_MOCK_SERVER_HEALTH_CHECK_TIMEOUT', false);
        if (!$timeout) {
            $timeout = 10;
        }
        $this->setHealthCheckTimeout($timeout);

        $version = $this->parseEnv('PACT_SPECIFICATION_VERSION', false);
        if (!$version) {<commit_msg>Adding possibility to add server log path config from env/phpunit xml file<commit_after><?php

namespace PhpPact\Standalone\MockService;

use PhpPact\Standalone\Exception\MissingEnvVariableException;

/**
 * An environment variable based mock server configuration.
 * Class MockServerEnvConfig.
 */
class MockServerEnvConfig extends MockServerConfig
{
    const DEFAULT_SPECIFICATION_VERSION = '2.0.0';

    /**
     * MockServerEnvConfig constructor.
     *
     * @throws MissingEnvVariableException
     */
    public function __construct()
    {
        $this
            ->setHost($this->parseEnv('PACT_MOCK_SERVER_HOST'))
            ->setPort($this->parseEnv('PACT_MOCK_SERVER_PORT'))
            ->setConsumer($this->parseEnv('PACT_CONSUMER_NAME'))
            ->setProvider($this->parseEnv('PACT_PROVIDER_NAME'))
            ->setPactDir($this->parseEnv('PACT_OUTPUT_DIR', false))
            ->setCors($this->parseEnv('PACT_CORS', false));

        if ($logDir = $this->parseEnv('PACT_LOG', false)) {
            $this->setLog($logDir);
        }

        $timeout = $this->parseEnv('PACT_MOCK_SERVER_HEALTH_CHECK_TIMEOUT', false);
        if (!$timeout) {
            $timeout = 10;
        }
        $this->setHealthCheckTimeout($timeout);

        $version = $this->parseEnv('PACT_SPECIFICATION_VERSION', false);
        if (!$version) {
{'fraction_non_alphanumeric': 0.13033175355450238, 'fraction_numerical': 0.0039494470774091624, 'mean_word_length': 3.1254071661237783, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '529218', 'n_tokens_mistral': 762, 'n_tokens_neox': 751, 'n_words': 116}