依赖注入的小案例

Original 2019-06-14 14:22:49 151
abstract:/* * 03、依赖注入 * */  public function test(Request $request) {   Request $request === new Request();//这就是采用依赖注入的方式进行的 }

/*
* 03、依赖注入
* */

 public function test(Request $request)
{
  Request $request === new Request();//这就是采用依赖注入的方式进行的
}

Correcting teacher:天蓬老师Correction time:2019-06-14 15:05:41
Teacher's summary:这不是依赖注入, 依赖注入的基本特征, 就是对象参数的实例在客户端方法外部完成, 用户只需要在参数中进行类型约束, 就可以实现自动实例化过程

Release Notes

Popular Entries