Skip to content

Commit

Permalink
minor #20051 [TypeInfo] fix typos (xabbuh)
Browse files Browse the repository at this point in the history
This PR was merged into the 7.1 branch.

Discussion
----------

[TypeInfo] fix typos

Commits
-------

47279ab fix typos
  • Loading branch information
javiereguiluz committed Jul 19, 2024
2 parents f47bfb7 + 47279ab commit 38f3e6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/type_info.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ based on reflection or a simple string::

// Type instances have several helper methods

// returns the main type (e.g. in this example i returns an "array" Type instance);
// returns the main type (e.g. in this example it returns an "array" Type instance);
// for nullable types (e.g. string|null) it returns the non-null type (e.g. string)
// and for compound types (e.g. int|string) it throws an exception because both types
// can be considered the main one, so there's no way to pick one
$baseType = $type->getBaseType();

// for collections, it returns the type of the item used as the key;
// in this example, the collection is a list, so it returns and "int" Type instance
// in this example, the collection is a list, so it returns an "int" Type instance
$keyType = $type->getCollectionKeyType();

// you can chain the utility methods (e.g. to introspect the values of the collection)
Expand Down

0 comments on commit 38f3e6c

Please sign in to comment.