@@ -78,9 +78,8 @@ public function addDefinition(string $name, ServiceDefinition $definition = null
7878
7979 /**
8080 * Removes the specified service definition.
81- * @return void
8281 */
83- public function removeDefinition (string $ name )
82+ public function removeDefinition (string $ name ): void
8483 {
8584 $ this ->classListNeedsRefresh = true ;
8685 $ name = $ this ->aliases [$ name ] ?? $ name ;
@@ -141,9 +140,8 @@ public function addAlias(string $alias, string $service)
141140
142141 /**
143142 * Removes the specified alias.
144- * @return void
145143 */
146- public function removeAlias (string $ alias )
144+ public function removeAlias (string $ alias ): void
147145 {
148146 unset($ this ->aliases [$ alias ]);
149147 }
@@ -184,7 +182,7 @@ public function addExcludedClasses(array $types)
184182 * @return string|null service name or null
185183 * @throws ServiceCreationException
186184 */
187- public function getByType (string $ type , bool $ throw = false )
185+ public function getByType (string $ type , bool $ throw = false ): ? string
188186 {
189187 $ type = Helpers::normalizeClass ($ type );
190188
@@ -199,7 +197,7 @@ public function getByType(string $type, bool $throw = false)
199197 if ($ throw ) {
200198 throw new MissingServiceException ("Service of type ' $ type' not found. " );
201199 }
202- return ;
200+ return null ;
203201
204202 } elseif (count ($ types [$ type ][true ]) === 1 ) {
205203 return $ types [$ type ][true ][0 ];
@@ -272,10 +270,9 @@ public function getClassList(): array
272270
273271 /**
274272 * Generates $dependencies, $classList and normalizes class names.
275- * @return void
276273 * @internal
277274 */
278- public function prepareClassList ()
275+ public function prepareClassList (): void
279276 {
280277 unset($ this ->definitions [self ::THIS_CONTAINER ]);
281278 $ this ->addDefinition (self ::THIS_CONTAINER )->setType (Container::class);
@@ -515,10 +512,7 @@ private function resolveEntityType($entity, array $recursive = [])
515512 }
516513
517514
518- /**
519- * @return void
520- */
521- public function complete ()
515+ public function complete (): void
522516 {
523517 $ this ->prepareClassList ();
524518
@@ -699,10 +693,9 @@ public function normalizeEntity($entity)
699693
700694 /**
701695 * Converts @service or @\Class -> service name and checks its existence.
702- * @return string|null
703696 * @internal
704697 */
705- public function getServiceName ($ arg )
698+ public function getServiceName ($ arg ): ? string
706699 {
707700 if (!is_string ($ arg ) || !preg_match ('#^@[\w \\\\.][^:]*\z# ' , $ arg )) {
708701 return null ;
0 commit comments