/** * Merges the provided parameters with the reflection parameters. * * @param array $reflectionParams Reflection parameters * @param array $providedParams Provided parameters * * @return array */ private function mergeParams(array $reflectionParams, array $providedParams) { $params = []; foreach ($reflectionParams as $key => $reflectionParam) { if (isset($providedParams[$reflectionParam->getName()])) { $params[] = Arr::pull($providedParams, $reflectionParam->getName()); } elseif (isset($providedParams[$key])) { $params[] = Arr::pull($providedParams, $key); } else { $params[] = $reflectionParam; } } return array_merge($params, array_values($providedParams)); }
/** * Removes a config param using "dot notation". * * @param string $path * * @return mixed */ public final function remove($path) { list($filename, $path) = $this->parsePath($path); $this->loaded($filename) or $this->load($filename); Arr::remove($this->params[$filename], $path); }