时间:2021-07-01 10:21:17 帮助过:22人阅读
concrete = $concrete; $this->container = $container;// set the } /** * Define the abstract target that depends on the context. * * @param string $abstract * @return $this */ public function needs($abstract) { $this->needs = $abstract; return $this; }// function is needs /** * Define the implementation for the contextual binding. * * @param \Closure|string $implementation * @return void */ public function give($implementation) { $this->container->addContextualBinding($this->concrete, $this->needs, $implementation); }// Define the implementation for the contextual binding}