每天laravel-20160816| Container -19
2016-05-27 09:06
399 查看
/** * If extra parameters are passed by numeric ID, rekey them by argument name. * * @param array $dependencies * @param array $parameters * @return array */ protected function keyParametersByArgument(array $dependencies, array $parameters) {// this function is work for change the numeric ID key to string name key foreach ($parameters as $key => $value) {// loop the parameters if (is_numeric($key)) {// if a numeric unset($parameters[$key]);// first unset it $parameters[$dependencies[$key]->name] = $value;// then parameters return // get the string key } } return $parameters; } /** * Register a new resolving callback. * * @param string $abstract * @param \Closure|null $callback * @return void */ public function resolving($abstract, Closure $callback = null) { if ($callback === null && $abstract instanceof Closure) {// if no callback and abstract is a Closure $this->resolvingCallback($abstract);// get the call back,use another way to save it } else { $this->resolvingCallbacks[$this->normalize($abstract)][] = $callback;// save the function to the abstract } }// register a new function for callback /** * Register a new after resolving callback for all types. * * @param string $abstract * @param \Closure|null $callback * @return void */ public function afterResolving($abstract, Closure $callback = null) {// set the callback function used after resolve function done if ($abstract instanceof Closure && $callback === null) { $this->afterResolvingCallback($abstract);// if null, use other function } else { $this->afterResolvingCallbacks[$this->normalize($abstract)][] = $callback; }// register the callback to the array store }//
相关文章推荐
- php开发环境安装
- php......注册审核
- 如何配置我的php环境
- 如何配置php运行环境
- php性能测试工具--xhprof
- php中关于长度计算容易混淆的问题分析
- php使用number_format函数截取小数的方法分析
- php使用pdo连接sqlite3的配置示例
- Thinkphp自定义代码生成工具及用法说明(附下载地址)
- ThinkPHP3.2 扩展(钩子,HOOK)
- php 简单的session 购物车类
- php 一个好用的参数验证类
- php 退出代码
- yii
- thinkphp 3.2.3 计划任务具体实现实例教程
- php常用我会的三种排序算法
- GetProcAddress函数实现和分析
- 建造者模式以及php实现
- PHP页面跳转三种实现方法
- 原型模式及php实现