@@ -99,20 +99,20 @@ public function isStaticComplete(): bool
9999 * Returns a Generator providing an associative array [string => Definition]
100100 * that maps fully qualified symbol names to Definitions (global or not)
101101 *
102- * @return \Generator providing Definition[]
102+ * @return \Generator yields Definition
103103 */
104104 public function getDefinitions (): \Generator
105105 {
106106 yield from $ this ->yieldDefinitionsRecursively ($ this ->definitions );
107107 }
108108
109109 /**
110- * Returns a Generator providing the Definitions that are in the given FQN
110+ * Returns a Generator that yields all the descendant Definitions of a given FQN
111111 *
112112 * @param string $fqn
113- * @return \Generator providing Definitions[]
113+ * @return \Generator yields Definition
114114 */
115- public function getDefinitionsForFqn (string $ fqn ): \Generator
115+ public function getDescendantDefinitionsForFqn (string $ fqn ): \Generator
116116 {
117117 $ parts = $ this ->splitFqn ($ fqn );
118118 if ('' === end ($ parts )) {
@@ -188,7 +188,7 @@ public function removeDefinition(string $fqn)
188188 * Returns a Generator providing all URIs in this index that reference a symbol
189189 *
190190 * @param string $fqn The fully qualified name of the symbol
191- * @return \Generator providing string[]
191+ * @return \Generator yields string
192192 */
193193 public function getReferenceUris (string $ fqn ): \Generator
194194 {
@@ -280,9 +280,9 @@ public function serialize()
280280 }
281281
282282 /**
283- * Returns a Genrerator containing all the into the given $storage recursively.
284- * The generator yields key => value pairs, eg
285- * 'Psr\Log\LoggerInterface->log()' => $definition
283+ * Returns a Generator that yields all the Definitions in the given $storage recursively.
284+ * The generator yields key => value pairs, e.g.
285+ * ` 'Psr\Log\LoggerInterface->log()' => $definition`
286286 *
287287 * @param array &$storage
288288 * @param string $prefix (optional)
@@ -319,12 +319,12 @@ private function splitFqn(string $fqn): array
319319 $ parts = array_slice ($ parts , 1 );
320320 }
321321
322- $ parts [0 ] = '\\' . $ parts [0 ];
322+ $ parts [0 ] = '\\' . $ parts [0 ];
323323 }
324324
325325 // write back the backslashes prefixes for the other parts
326326 for ($ i = 1 ; $ i < count ($ parts ); $ i ++) {
327- $ parts [$ i ] = '\\' . $ parts [$ i ];
327+ $ parts [$ i ] = '\\' . $ parts [$ i ];
328328 }
329329
330330 // split the last part in 2 parts at the operator
@@ -337,7 +337,7 @@ private function splitFqn(string $fqn): array
337337 // replace the last part by its pieces
338338 array_pop ($ parts );
339339 $ parts [] = $ endParts [0 ];
340- $ parts [] = $ operator. $ endParts [1 ];
340+ $ parts [] = $ operator . $ endParts [1 ];
341341 break ;
342342 }
343343 }
@@ -382,8 +382,8 @@ private function getIndexValue(array $parts, array &$storage)
382382 }
383383
384384 /**
385- * Recusrive function which store the given definition in the given $storage
386- * array represented as a tree matching the given $parts.
385+ * Recursive function that stores the given Definition in the given $storage array represented
386+ * as a tree matching the given $parts.
387387 *
388388 * @param int $level The current level of FQN part
389389 * @param string[] $parts The splitted FQN
@@ -408,11 +408,9 @@ private function indexDefinition(int $level, array $parts, array &$storage, Defi
408408 }
409409
410410 /**
411- * Recusrive function which remove the definition matching the given $parts
412- * from the given $storage array.
413- * The function also looks up recursively to remove the parents of the
414- * definition which no longer has children to avoid to let empty arrays
415- * in the index.
411+ * Recursive function that removes the definition matching the given $parts from the given
412+ * $storage array. The function also looks up recursively to remove the parents of the
413+ * definition which no longer has children to avoid to let empty arrays in the index.
416414 *
417415 * @param int $level The current level of FQN part
418416 * @param string[] $parts The splitted FQN
0 commit comments