Process enclosed field

example: "value"

@param string $value  Current token
@param array  $option Option
495950
private function processEnclosedField($value, array $option)
    {
        // then, remove enclosure and line feed
        $cell = $this->trimEnclosure($value, $option['enclosure']);
        // replace the escape sequence "" to "
        $cell = $this->unescapeEnclosure($cell, $option['enclosure']);

        $this->setCell($cell);
        $this->col++;
        $this->continue = false;
    }
32708
protected function processGetValue($value, $params = [], $processCallbacks = true)
    {
        return $processCallbacks ? $this->processCallback($this->onGetCallback, $value, $params) : $value;
    }
1256479
private function processContinuousField($value, array $option)
    {
        $cell = $this->trimLeftEnclosure($value, $option['enclosure']);
        $cell = $this->unescapeEnclosure($cell, $option['enclosure']);

        $this->setCell($cell);
        $this->continue = true;
    }
73146
protected function process_output( $output, $value ) {
		$output = wp_parse_args(
			$output,
			[
				'media_query' => 'global',
				'element'     => 'body',
				'prefix'      => '',
				'suffix'      => '',
			]
		);

		foreach ( [ 'background-image', 'background-color', 'background-repeat', 'background-position', 'background-size', 'background-attachment' ] as $property ) {

			// See https://github.com/aristath/kirki/issues/1808.
			if ( 'background-color' === $property && isset( $value['background-color'] ) && $value['background-color'] && ( ! isset( $value['background-image'] ) || empty( $value['background-image'] ) ) ) {
				$this->styles[ $output['media_query'] ][ $output['element'] ]['background'] = $output['prefix'] . $this->process_property_value( $property, $value[ $property ] ) . $output['suffix'];
			}

			if ( isset( $value[ $property ] ) && ! empty( $value[ $property ] ) ) {
				$this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $this->process_property_value( $property, $value[ $property ] ) . $output['suffix'];
			}
		}
	}
1179585
protected function process_output( $output, $value ) {
		$output = wp_parse_args(
			$output,
			[
				'element'     => '',
				'property'    => '',
				'media_query' => 'global',
				'prefix'      => '',
				'suffix'      => '',
			]
		);

		if ( ! is_array( $value ) ) {
			return;
		}

		foreach ( array_keys( $value ) as $key ) {

			$property = ( empty( $output['property'] ) ) ? $key : $output['property'] . '-' . $key;
			if ( isset( $output['choice'] ) && $output['property'] ) {
				if ( $key === $output['choice'] ) {
					$property = $output['property'];
				} else {
					continue;
				}
			}
			if ( false !== strpos( $output['property'], '%%' ) ) {
				$property = str_replace( '%%', $key, $output['property'] );
			}
			$this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $this->process_property_value( $property, $value[ $key ] ) . $output['suffix'];
		}
	}
6743
protected function process_output( $output, $value ) {
		foreach ( $value as $key => $sub_value ) {

			// If "element" is not defined, there's no reason to continue.
			if ( ! isset( $output['element'] ) ) {
				continue;
			}

			// If the "choice" is not the same as the $key in our loop, there's no reason to proceed.
			if ( isset( $output['choice'] ) && $key !== $output['choice'] ) {
				continue;
			}

			// If "property" is not defined, fallback to the $key.
			$property = ( ! isset( $output['property'] ) || empty( $output['property'] ) ) ? $key : $output['property'];

			// If "media_query" is not defined, use "global".
			if ( ! isset( $output['media_query'] ) || empty( $output['media_query'] ) ) {
				$output['media_query'] = 'global';
			}

			// If "suffix" is defined, add it to the value.
			$output['suffix'] = ( isset( $output['suffix'] ) ) ? $output['suffix'] : '';

			// Create the styles.
			$this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $sub_value . $output['suffix'];

		}
	}
776936
public function setOpt($option, $value)
    {
        /**
         * @var Curl $instance
         */
        foreach ($this->curlInstances as $instance) {
            $instance->setOpt($option, $value);
        }
    }
913415
private function processValue($value)
    {
        $this->valueStack[] = $value;
        $value = $this->resolveValue($value);

        if (is_array($value) || is_object($value)) {
            $this->pushStack($value);
        } else {
            $this->outputJson($value, JsonToken::T_VALUE);
            array_pop($this->valueStack);
        }
    }
78159
public function setOption($option, $value) {
        if(CurlOptions::checkOptionValue($option,$value)) {
            return curl_setopt($this->handle, $option, $value);
        }
    }
598634
public function setCurlOption($option, $value)
    {
        $this->debug("setCurlOption option=$option, value=");
        $this->appendDebug($this->varDump($value));
        curl_setopt($this->ch, $option, $value);
    }
670522
public function setOption(string $option, $value) {
        $this->validateOption($option, $value);
        $this->options[$option] = $value;
    }
857702
protected function &_parse_entry($value)
    {
        // tokens that have no value associated
        $noValue = array('single-value',
                         'obsolete',
                         'collective',
                         'no-user-modification',
                         'abstract',
                         'structural',
                         'auxiliary');

        // tokens that can have multiple values
        $multiValue = array('must', 'may', 'sup');

        $schema_entry = array('aliases' => array()); // initilization

        $tokens = $this->_tokenize($value); // get an array of tokens

        // remove surrounding brackets
        if ($tokens[0] == '(') array_shift($tokens);
        if ($tokens[count($tokens) - 1] == ')') array_pop($tokens); // -1 doesnt work on arrays :-(

        $schema_entry['oid'] = array_shift($tokens); // first token is the oid

        // cycle over the tokens until none are left
        while (count($tokens) > 0) {
            $token = strtolower(array_shift($tokens));
            if (in_array($token, $noValue)) {
                $schema_entry[$token] = 1; // single value token
            } else {
                // this one follows a string or a list if it is multivalued
                if (($schema_entry[$token] = array_shift($tokens)) == '(') {
                    // this creates the list of values and cycles through the tokens
                    // until the end of the list is reached ')'
                    $schema_entry[$token] = array();
                    while ($tmp = array_shift($tokens)) {
                        if ($tmp == ')') break;
                        if ($tmp != '$') array_push($schema_entry[$token], $tmp);
                    }
                }
                // create a array if the value should be multivalued but was not
                if (in_array($token, $multiValue) && !is_array($schema_entry[$token])) {
                    $schema_entry[$token] = array($schema_entry[$token]);
                }
            }
        }
        // get max length from syntax
        if (key_exists('syntax', $schema_entry)) {
            if (preg_match('/{(\d+)}/', $schema_entry['syntax'], $matches)) {
                $schema_entry['max_length'] = $matches[1];
            }
        }
        // force a name
        if (empty($schema_entry['name'])) {
            $schema_entry['name'] = $schema_entry['oid'];
        }
        // make one name the default and put the other ones into aliases
        if (is_array($schema_entry['name'])) {
            $aliases                 = $schema_entry['name'];
            $schema_entry['name']    = array_shift($aliases);
            $schema_entry['aliases'] = $aliases;
        }
        return $schema_entry;
    }
279894
private function processValue($section, $value, $config = [])
    {
        // Need to catch Exception in case INI string is not properly formed
        try {
            // Make sure $config is an ArrayObject
            $config = $this->arr($config);
        } catch (StdObjectException $e) {
            $config = $this->arr();
        }

        // Create StringObject and trim invalid characters
        $section = $this->str($section);
        $this->validateSection($section);

        // Handle nested sections, ex: parent.child.property
        if ($section->contains($this->delimiter)) {
            /**
             * Explode section and only take 2 elements
             * First element will be the new array key, and second will be passed for recursive processing
             * Ex: parent.child.property will be split into 'parent' and 'child.property'
             */
            $sections = $section->explode($this->delimiter, 2)->removeFirst($section);
            $localConfig = $config->key($section, [], true);
            $config->key($section, $this->processValue($sections->last()->val(), $value, $localConfig));
        } else {
            // If value is an array, we need to process it's keys
            if ($this->isArray($value)) {
                foreach ($value as $k => $v) {
                    $localConfig = $config->key($section, [], true);
                    $config->key($section, $this->processValue($k, $v, $localConfig));
                }
            } else {
                $config->key($section, $value);
            }
        }

        return $config->val();
    }
1083777
public function processValue($value)
	{
		$clean = strip_tags($value);

		if (array_key_exists($clean, $this->types)) {
			if (!isset($this->types[$clean]['value'])) {
				$this->types[$clean]['value'] = 0;
			}
			$this->types[$clean]['value'] += 1;
		}
	}
1064796
protected function handleStructParameter( $value )
    {
        $values = array();
        foreach ( $value->member as $value )
        {
            $values[(string)$value->name] = $this->processParameter( (array)$value->value );
        }

        return $values;
    }
488794
public static function set($option, $value)
    {
        if (!array_key_exists($option, self::$conf))
        {
            throw new InvalidArgumentException(sprintf('Unknown option "%s"', $option));
        }

        $expected = gettype(self::$conf[$option]);
        $actual = gettype($value);
        if ($expected != $actual)
        {
            throw new InvalidArgumentException(
                sprintf('Option "%s" has type "%s", but "%s" given',
                    $option, $expected, $actual)
            );
        }

        self::$conf[$option] = $value;
    }
1366024
private function processClosingField($value, array $option)
    {
        $cell = $this->trimRightEnclosure($value, $option['enclosure']);
        $cell = $this->unescapeEnclosure($cell, $option['enclosure']);

        $this->joinCell($this->revert . $cell);
        $this->continue = false;
        $this->col++;
    }