매일laravel-20160814|Container -17
/**
* Resolve all of the dependencies from the ReflectionParameters.
*
* @param array $parameters
* @param array $primitives
* @return array
*/
// Resolve all of the dependencies from the ReflectionParameters.
protected function getDependencies(array $parameters, array $primitives = [])
{// if you want resolve the Dependencies ,first you need get it
$dependencies = [];// set a array dependencies
foreach ($parameters as $parameter) {// loop the parameters as parameter
$dependency = $parameter->getClass();// what ever get the Class name
// may set the name about the parameter
// If the class is null, it means the dependency is a string or some other
// primitive type which we can not resolve since it is not a class and
// we will just bomb out with an error since we have no-where to go.
if (array_key_exists($parameter->name, $primitives)) {// if the name in the primitives
$dependencies[] = $primitives[$parameter->name];// has the dependencies array
} elseif (is_null($dependency)) {// if is null
$dependencies[] = $this->resolveNonClass($parameter);// change the Non Class
} else {
$dependencies[] = $this->resolveClass($parameter);// resolveClass
}
}
return $dependencies;// ever thing done ,return the result
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
return / break / continue반복문을 종료 시키기도 하지만 값을 반환하고 함수 자체를 종료 함수에서 사용하지 않으면 에러가 발생 ⇒ 함수는 return을 사용하지 않아도 항상 값을 반환함 (기본값은 undefined) 반복문을 더 이상 진행하지...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.