识别In条件的参数数组
@param string|array $value
@return array
19738
private function markIn($value): array
    {
        // 已经是数组,直接返回
        if (is_array($value)) {
            return $value;
        }

        // 除了数组,只能是字符串
        if (!is_string($value)) {
            trigger_error('in运算符的值必须是字符串或数组:' . json($value), E_USER_ERROR);
        }

        // 尝试按逗号分解
        $arr = explode(',', $value);
        if (count($arr) > 1) {
            return $arr;
        }

        // 尝试按空格分解
        $arr = explode(' ', $value);
        if (count($arr) > 1) {
            return $arr;
        }

        // 看来只能是单值了
        return [$value];
    }
551762
private function parseValue($value)
    {
        if (is_string($value))
            return new String_($value);
        if (is_bool($value))
            return new ConstFetch(new Name([$value ? 'true' : 'false']));
        if (is_float($value))
            return new DNumber($value);
        if (is_numeric($value))
            return new LNumber($value);
        if (is_array($value)) {
            $items = [];
            foreach ($value as $key => $value) {
                $items[] = new ArrayItem(
                    $this->parseValue($value),
                    $this->parseValue($key)
                );
            }
            return new Array_($items);
        }
        return null;
    }
1069417
private function sqlIn(array $value): string
    {
        // 将数组中的值,逐个加上定界符
        foreach ($value as $k => $v) {
            $value[$k] = $this->markValue($v);
        }

        // 数组转为 逗号分隔列表
        return '(' . implode(',', $value) . ')';
    }
1108472
public function searchByValue($value):array{

		$matches = [];

		foreach($this->iterator as $v){

			if($v === $value){
				$matches[$this->getPath()] = $value;
			}

		}

		return $matches;
	}
1302641
public function contains($value)
        {
            if ($value instanceof \Closure) {
                return ! is_null($this->first($value));
            }

            return Arrays::in($value, $this->_items);
        }
468011
protected function adjustValue($value)
    {
        if (is_string($value)) {
            $value = explode(';', $value);
        }

        if ( ! $value) {
            $value = [];
        }

        return array_filter($value);
    }
670033
public static function items($value)
	{
		$cache_key = md5($value);

		if (Arr::get(self::$_cache, $cache_key))
		{
			return self::$_cache[$cache_key];
		}

		self::$_cache[$cache_key] = array(
			'load'		=> FALSE,
			'items'	=> array()
		);

		foreach (explode(' - ', $value) as $items)
		{
			$new_item = array();

			if ( ! trim($items))
				continue;

			foreach (explode("\n", $items) as $key_value)
			{
				if ( ! trim($key_value))
					continue;

				$item = explode(':', $key_value);
				$new_item[trim($item[0])] = trim($item[1]);
			}

			self::$_cache[$cache_key]['items'][] = $new_item;
		}

		if (self::$_cache[$cache_key]['items'])
		{
			self::$_cache[$cache_key]['load'] = TRUE;
		}

		return self::$_cache[$cache_key];
	}
628975
public static function getValueAsList($value) {
		$tokens = token_get_all('<?php '.$value);

		$resultArray = array();
		
		// Le's find all the strings, and let's put each string in the table.
		foreach ($tokens as $token) {
			if ($token[0] == T_CONSTANT_ENCAPSED_STRING) {
				$resultArray[] = substr($token[1], 1, strlen($token[1])-2) ;
			}
		}

		return  $resultArray;
	}
836848
public function parse(string $value)
    {
        $parsedValue = $this->parser->parse($value);
        if (false === $parsedValue instanceof ListValue) {
            return $parsedValue;
        }

        $mergedValues = array_reduce(
            $parsedValue->getValue(),
            [$this, 'mergeStrings'],
            $initial = []
        );

        return (1 === count($mergedValues))
            ? $mergedValues[0]
            : new ListValue($mergedValues)
        ;
    }
1153954
public static function convertToPhp($value)
    {
        if (!is_array($value)) {
            return [];
        }

        // see DateType::convertToPHPValue()
        $convertor = function ($value) {
            try {
                return DateType::getDateTime($value);
            } catch (\InvalidArgumentException $e) {
                return null;
            }
        };

        return array_values(array_filter(array_map($convertor, $value)));
    }
306430
public function get($value)
    {

        if (!empty($this->_array[$value])) {
            return $this->_array[$value];
        } else {
            return $value;
        }

    }
357887
public static function toArray($value)
    {
        $data = [];

        $cookies = $value ? explode(';', $value) : [];
        foreach ($cookies as $cookie) {
            list($name, $value) = explode('=', $cookie);
            $name = trim($name);
            $value = urldecode($value);
            if (!isset($data[$name])) {
                $data[$name] = $value;
            }
        }
        return $data;
    }
976433
public function cast($value): array
    {
        $result = [];
        foreach ((array)$value as $key => $itemValue) {
            $result[$key] = $this->type->cast($itemValue);
        }
        return $result;
    }
819719
public function filter($value)
    {
        if (!is_scalar($value) && !is_array($value)) {
            return $value;
        }

        if (StringUtils::hasPcreUnicodeSupport()) {
            $pattern     = ['#(?<=(?:\p{Lu}))(\p{Lu}\p{Ll})#', '#(?<=(?:\p{Ll}|\p{Nd}))(\p{Lu})#'];
            $replacement = [$this->separator . '\1', $this->separator . '\1'];
        } else {
            $pattern     = ['#(?<=(?:[A-Z]))([A-Z]+)([A-Z][a-z])#', '#(?<=(?:[a-z0-9]))([A-Z])#'];
            $replacement = ['\1' . $this->separator . '\2', $this->separator . '\1'];
        }

        return preg_replace($pattern, $replacement, $value);
    }
187766
public function filter($value)
    {
        return is_array($value) ? array_map(array($this, __FUNCTION__), $value) : stripslashes($value);
    }
413634
public static function notEmpty($value)
    {
        if (is_object($value) && $value instanceof ArrayObject)
        {
            // 如果是个ArrayObject对象，那么先读取起内容
            $value = $value->getArrayCopy();
        }

        return ! in_array($value, [
            null,
            false,
            '',
            []
        ], true);
    }
1104365
public function filter($value)
    {
        if (null === $value) {
            return null;
        }
        $this->checkValueIsArrayOrThrowException($value);

        $return = [];
        foreach ($value as $header => $condition) {
            $return[$header] = $this->conditionFilter->filter($condition);
        }

        return $return;
    }