提取参数默认值
@param  Object $parameter 参数
@return Object
514404
protected function resolveNonClass($parameter) {
        try {
            #有默认值则返回默认值
            if ($parameter->isDefaultValueAvailable()) {
                return $parameter->getDefaultValue();
            }
            throw new Exception('参数无默认值，无法实例化', ErrorCode::$InstantiationError);
        } catch (Exception $e) {
            ERRORCODE($e);
        }
    }
617033
public function get($parameter=null) {

        if ( is_null($parameter) ) return $this->parameters;

        return array_key_exists($parameter, $this->parameters) ?
            $this->parameters[$parameter] : null;

        // substitution by backreference is cool but hard compute for a large set of values :(
        //
        // if ( is_scalar($value) && preg_match_all('/%(.+?)%/', $value, $matches, PREG_SET_ORDER) ) {
        //
        //     $substitutions = array();
        //
        //     foreach ( $matches as $match ) {
        //
        //         $backreference = $match[1];
        //
        //         if ( $backreference != $property && !isset($substitutions['/%'.$backreference.'%/']) ) {
        //
        //             $substitutions['/%'.$backreference.'%/'] = $this->get($backreference);
        //
        //         }
        //
        //     }
        //
        //     $value = preg_replace(array_keys($substitutions), array_values($substitutions), $value);
        //
        // }

    }
432268
public function getUrl($address = NULL, $parameter = NULL) {
        if (strstr($address, "http://") || strstr($address, "https://") || strstr($address, "//")) {
            return $address;
        }
        $array = explode("/", $address);
        $count = count($array);
        $par   = array();
        $url   = null;
        switch ($count) {
        case '3':
            $root     = rtrim(ROOT, "/") . '/' . $array[0];
            $par['c'] = $array[1];
            $par['a'] = $array[2];
            break;
        case '2':
            $root     = rtrim(ROOT, "/");
            $par['c'] = $array[0];
            $par['a'] = $array[1];
            break;
        default:
        case '1':
            $root     = rtrim(ROOT, "/");
            $par['c'] = $_GET['model'];
            $par['a'] = $array[0];
            break;
        }
        #转换参数信息
        if (!empty($parameter)) {
            if (strstr($parameter, "=")) {
                $array = explode(';', $parameter);
                foreach ($array as $key => $value) {
                    $value          = explode('=', $value);
                    $par[$value[0]] = $value[1];
                }
            } elseif (strstr($parameter, "/")) {
                $array = explode('/', $parameter);
                for ($i = 0; $i < count($array); $i += 2) {
                    $par[$array[$i]] = $array[$i + 1];
                }
            } elseif (is_array($parameter)) {
                $par = $parameter;
            }
        }
        #进行参数拼接
        foreach ($par as $key => $value) {
            if ($key == 'c' || $key == 'a' || $key == 'w') {
                $url .= "/{$value}";
            } else {
                $url .= "/{$key}/{$value}";
            }
        }
        return $root . $url;
    }
270849
public function filterByParameter($parameter)
    {
        $callback = function (BindingInterface $binding, $key) use ($parameter) {
            return $binding->getParameter() == $parameter;
        };

        return $this->filter($callback);
    }
255968
public function getType($parameter='')
	{
		$parameterType = null;
		switch (gettype($parameter)) {
			case 'string':
				$parameterType = 's';
				break;
			case 'numeric':
			case 'integer':
				$parameterType = 'i';
				break;
			case 'double':
				$parameterType = 'd';
				break;
			default:
				$parameterType = null;
				break;
		}

		return $parameterType;
	}
365294
public function makeGetProfileRequest($parameters)
    {
        $obj = new CIMGetProfileRequest($this->httpClient, $this->httpRequest);
        $obj->initialize(array_replace($this->getParameters(), $parameters));
        return $obj->send();
    }
356520
private function bind($key, $parameter)
    {
        if (is_null($parameter->getClass())) {
            return $this->arguments[$key] ?? null;
        }

        $class = $parameter->getClass()->name;

        $object = Arr::first($this->arguments, function ($value) use ($class) {
            return is_subclass_of($value, $class) || is_a($value, $class);
        });

        if (is_null($object)) {
            $object = app()->make($class);

            if (method_exists($object, 'resolveRouteBinding') && isset($this->arguments[$key])) {
                $object = $object->resolveRouteBinding($this->arguments[$key]);
            }
        }

        return $object;
    }
815995
protected function wrapPHPValue($parameter)
    {
        switch ($parameter['default']['type']) {
            case 'null':
                return 'null';
                break;

            case 'string':
            case 'char':
                return '\''.addslashes($parameter['default']['value']).'\'';
                break;

            case 'empty-array':
                return 'array()';
                break;

            case 'array':
                $parameters = [];

                foreach ($parameter['default']['left'] as $value) {
                    $source = '';

                    if (isset($value['key'])) {
                        $source .= $this->wrapPHPValue([
                            'default' => $value['key'],
                            'type' => $value['key']['type'],
                        ]).' => ';
                    }

                    $parameters[] = $source.$this->wrapPHPValue([
                        'default' => $value['value'],
                        'type' => $value['value']['type'],
                    ]);
                }

                return 'array('.implode(', ', $parameters).')';
                break;

            case 'static-constant-access':
                return $parameter['default']['left']['value'].'::'.$parameter['default']['right']['value'];
                break;

            case 'int':
            case 'double':
            case 'bool':
                return $parameter['default']['value'];
                break;

            default:
                throw new Exception('Stubs - value with type: '.$parameter['default']['type'].' is not supported');
                break;
        }
    }
102567
public function getObject(array $parameters = array())
    {
        if ($this->url === null) {
            throw new \InvalidArgumentException('Missing URL.');
        }

        if ($this->endpoint === null) {
            $this->endpoint = $this->discover($this->url);
        }

        $sign = '?';
        if ($query = parse_url($this->endpoint, PHP_URL_QUERY)) {
            $sign = '&';

            parse_str($query, $parameters);
        }

        if (!isset($parameters['url'])) {
            $parameters['url'] = $this->url;
        }
        if (!isset($parameters['format'])) {
            $parameters['format'] = 'json';
        }

        $client = new Client(
            sprintf('%s%s%s', $this->endpoint, $sign, http_build_query($parameters))
        );

        $data = $client->send();

        switch ($parameters['format']) {
            case 'json':
                $data = json_decode($data);
                if (!is_object($data)) {
                    throw new \InvalidArgumentException('Could not parse JSON response.');
                }

                break;

            case 'xml':
                libxml_use_internal_errors(true);
                $data = simplexml_load_string($data);
                if (!$data instanceof \SimpleXMLElement) {
                    $errors = libxml_get_errors();
                    $error  = array_shift($errors);
                    libxml_clear_errors();
                    libxml_use_internal_errors(false);
                    throw new \InvalidArgumentException($error->message, $error->code);
                }

                break;
        }

        return Object::factory($data);
    }
1329087
public function get($parameter)
    {
        return isset($this->credentials[$parameter]) ? $this->credentials[$parameter] : null;
    }
532698
private function getDefaultAsExpr($parameter)
    {
        $expr = $this->parser->parse('<?php ' . var_export($parameter->getSchema()->getDefault(), true) . ';')[0];

        if ($expr instanceof Stmt\Expression) {
            return $expr->expr;
        }

        return $expr;
    }
1115026
public function make($abstract, array $parameters = array())
    {
        $abstract = $this->getAlias($this->normalize($abstract));
        //反复make同一抽象时， 返回同一个对象
        if (isset($this->instances[$abstract]) && !is_null($this->instances[$abstract])) {
            return $this->instances[$abstract];
        }
        //获取抽象类对应的具体对象
        $concrete = $this->getConcrete($abstract);
        //当前具体类型是可以build时，
        if ($this->isBuildable($concrete, $abstract)) {
            $object = $this->build($concrete, $parameters);
        } else {
            $object = $this->make($concrete, $parameters);
        }
        //若容器中有该具体类的扩展回调
        foreach ($this->getExtenders($abstract) as $extender) {
            $object = $extender($object, $this);
        }
        if ($this->isShared($abstract)) {
            $this->instances[$abstract] = $object;
        }
        $this->resoleved[$abstract] = true;
        return $object;
    }
677609
public function make($abstract, $parameters = [])
    {
        $abstract = ucfirst($abstract);
        if (isset($this->Instances[$abstract])) {
            return $this->Instances[$abstract];
        }
        //未定义的服务类 返回空值;
        if (!isset($this->Providers[$abstract])) {
            return null;
        }
        // echo $abstract;
        $parameters = $parameters ?: isset($this->ObjectConfig[$abstract]) ? $this->ObjectConfig[$abstract] : [];
        $this->Instances[$abstract] = $this->build($abstract, $parameters);
        return $this->Instances[$abstract];
    }
8965
public function handle(\ReflectionParameter $parameter)
    {
        $func = $parameter->getDeclaringFunction();
        $method = new \ReflectionMethod($parameter->getDeclaringClass()->name, $func->name);
        $parameter->getDeclaringFunction()->name;
        $annotations = $this->reader->getMethodAnnotations($method);
        foreach ($annotations as $annotation) {
            if ($annotation instanceof ResourceParam && $annotation->param === $parameter->name) {
                return $this->getResourceParam($annotation->uri);
            }
        }
        (new VoidParamHandler)->handle($parameter);
    }
344431
public function removeParameters(array $parameters = null)
  {
    if ($this->isLocked()) {
      return $this->getObj()->removeParameters($parameters)->setLocked();
    } else {
      return parent::removeParameters($parameters);
    }
  }
52740
public function getValueBy(ParameterInterface $parameter)
    {
        if ($this->isExistBy($parameter) === false) {
            throw new NoBindParameterException('No parameter: ' . (string) $parameter);
        }

        return $this->parameters[$parameter->getHash()];
    }
1333482
public function setParameter(string $parameter, string $value): self
    {
        $this->parameters[$parameter] = $value;

        return $this;
    }