获取本地文件
@param  string $value [description]
@return [type]        [description]
554407
public function getLocalFile($file = '') {
        #判断数据不为空
        if (empty($file)) {
            return [];
        }
        $data = [];
        foreach ($file as $key => $value) {
            $path = ROOT_DIR . $value['name'];
            if (is_file($path)) {
                #获取文件内容
                $value['content'] = encrypt(file_get_contents($path));
                $data[]           = $value;
            }
        }
        return $data;
    }
850043
public function filter($value)
    {
        return str_getcsv($value, $this->delimiter, $this->enclosure, $this->escape);
    }
311501
protected function generateNewChecksum($value)
    {
        !is_string($value) && $value = (is_object($value) ? spl_object_hash($value) : serialize($value));

        return md5($value);
    }
98607
public function transform(string $value): string {
        
        if (strpos($value, 'hdl.handle.net') !== false) {
            $value = str_replace("http://", "", $value);
        }else if(strpos($value, 'https') !== false) {
            $value = str_replace("https://", "", $value);
        }else {
            $value = str_replace("http://", "", $value);
        }
        return $value;
        
    }
1263891
public function parseValue($value): UploadedFile
    {
        if (! $value instanceof UploadedFile) {
            throw new Error(
                'Could not get uploaded file, be sure to conform to GraphQL multipart request specification: https://github.com/jaydenseric/graphql-multipart-request-spec Instead got: '.Utils::printSafe($value)
            );
        }

        return $value;
    }
1149776
public function marshal($value)
    {
        if ($value === null || $value === '' || is_array($value)) {
            return null;
        }

        return (string)$value;
    }
149473
public static function format($value)
    {
        $value = Utils::toString($value);
        $value = mb_strtolower($value);

        if (Utils::isZeroPrefixed($value)) {
            return $value;
        } else {
            $value = Utils::toHex($value, true);
        }
        return $value;
    }
347486
public function filter($value)
    {
        if ($this->encodingFormat !== null) {
            return mb_strtolower($value, $this->encodingFormat);
        }

        return mb_strtolower($value);
    }
11088
public function transform($value)
    {
        if (is_array($value)) {
            $value = $value[FileType::UPLOAD_FIELDNAME];
        }

        try {
            return array(
                FileType::UPLOAD_FIELDNAME => new File(call_user_func($this->callback, $value, $this->property))
            );
        } catch (FileNotFoundException $e) {
            return null;
        }
    }
1042540
private static function _parseStringArray($value)
    {
        if (strlen($value)) {
            $vals = explode(',', $value);
            if ($vals === false)
                return false;
//            $vals = array_unique($vals); // 不需要去重, 不影响结果. 程序员不应该写出重复的字符串
        } else
            $vals = [''];
        if (count($vals) === 0)
            return false;
        return $vals;
    }
526705
public static function getType($value)
    {
        if (preg_match(self::REGEXP_TCP, $value)) {
            return self::TYPE_TCP;
        }

        if (preg_match(self::REGEXP_SSL, $value)) {
            return self::TYPE_SSL;
        }

        if (preg_match(self::REGEXP_UNIX, $value)) {
            return self::TYPE_UNIX;
        }

        return null;
    }
236510
public function sendKeys($value)
    {
        $local_file = $this->fileDetector->getLocalFile($value);
        if ($local_file === null) {
            $params = [
                'value' => WebDriverKeys::encode($value),
                ':id' => $this->id,
            ];
            $this->executor->execute(DriverCommand::SEND_KEYS_TO_ELEMENT, $params);
        } else {
            $remote_path = $this->upload($local_file);
            $params = [
                'value' => WebDriverKeys::encode($remote_path),
                ':id' => $this->id,
            ];
            $this->executor->execute(DriverCommand::SEND_KEYS_TO_ELEMENT, $params);
        }

        return $this;
    }
881602
public function encodeValue($value)
    {
        if ($this->urlEncode == self::RFC_3986) {
            return rawurlencode($value);
        } elseif ($this->urlEncode == self::FORM_URLENCODED) {
            return urlencode($value);
        } else {
            return (string) $value;
        }
    }
1094985
public static function hash($value)
    {
        $typeIdentifier = gettype($value)[0];

        switch ($typeIdentifier) {

            case 's': //string

                return 's' . (strlen($value) > 32 ? md5($value) : $value);

            case 'i': //integer
            case 'b': //boolean
            case 'd': //double
            case 'r': //resource
            case 'u': //unknown type

                return $typeIdentifier . $value;

            case 'N': //NULL

                return 'N';

            case 'o': //object

                return 'o' . spl_object_hash($value);

            case 'a': //array

                return self::arrayHash($value);
        }
    }
1239670
public function setHash($value) {
        // TODO: freeze the instance after configuration and automatically call copy()

        if (isset($value)) {
            if (!is_scalar($value)) throw new IllegalTypeException('Illegal type of parameter $value: '.gettype($value));
            if (is_bool($value))
                $value = (int) $value;
        }
        $value = (string) $value;
        $path = $this->getPath();
        $this->setPath(strLeftTo($path, '#', $count=1, $includeLimiter=false, $onNotFound=$path).'#'.$value);

        return $this;
    }
1062321
public static function cmd($value): string
    {
        $value = Str::low($value);
        $value = preg_replace('#[^a-z0-9\_\-\.]#', '', $value);
        $value = Str::trim($value);

        return $value;
    }
984258
public function convertFromUrlEncode($value)
    {
        $converted = urldecode($value);
        if (!$converted || $converted === $value) {
            return $value;
        } else {
            return $value . "\n" . $converted;
        }
    }