@@ -100,7 +100,7 @@ public function __destruct()
100100 * @return $this
101101 * @throws DependencyResolutionException
102102 */
103- public function set (string $ id , $ definition , array $ opts = [])
103+ public function set (string $ id , $ definition , array $ opts = []): self
104104 {
105105 $ id = $ this ->_checkServiceId ($ id );
106106
@@ -180,7 +180,7 @@ public function set(string $id, $definition, array $opts = [])
180180 * @throws \InvalidArgumentException
181181 * @throws DependencyResolutionException
182182 */
183- public function sets (array $ services )
183+ public function sets (array $ services ): self
184184 {
185185 foreach ($ services as $ id => $ definition ) {
186186 if (!$ definition ) {
@@ -212,7 +212,7 @@ public function sets(array $services)
212212 * @throws \InvalidArgumentException
213213 * @throws DependencyResolutionException
214214 */
215- public function protect (string $ id , $ definition , $ share = false )
215+ public function protect (string $ id , $ definition , $ share = false ): self
216216 {
217217 return $ this ->lock ($ id , $ definition , $ share );
218218 }
@@ -226,7 +226,7 @@ public function protect(string $id, $definition, $share = false)
226226 * @throws DependencyResolutionException
227227 * @throws \InvalidArgumentException
228228 */
229- public function lock (string $ id , $ definition , $ share = false )
229+ public function lock (string $ id , $ definition , $ share = false ): self
230230 {
231231 return $ this ->set ($ id , $ definition , [
232232 'shared ' => $ share ,
@@ -239,7 +239,7 @@ public function lock(string $id, $definition, $share = false)
239239 * @param ServiceProviderInterface $provider 在提供者内添加需要的服务到容器
240240 * @return $this
241241 */
242- public function registerServiceProvider (ServiceProviderInterface $ provider )
242+ public function registerServiceProvider (ServiceProviderInterface $ provider ): self
243243 {
244244 $ provider ->register ($ this );
245245
@@ -250,7 +250,7 @@ public function registerServiceProvider(ServiceProviderInterface $provider)
250250 * @param array $providers
251251 * @return $this
252252 */
253- public function registerServiceProviders (array $ providers )
253+ public function registerServiceProviders (array $ providers ): self
254254 {
255255 /** @var ServiceProviderInterface $provider */
256256 foreach ($ providers as $ provider ) {
0 commit comments