Skip to content

Commit

Permalink
Improve docs about return only types
Browse files Browse the repository at this point in the history
Void and never are types that can only be used for function return
types. Officially php doesn't have a category of types that are only
allowed for return, but I think it makes sense to name them like this.
  • Loading branch information
jaapio committed Sep 17, 2021
1 parent 17726a3 commit 4d427fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Types/Never_.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use phpDocumentor\Reflection\Type;

/**
* Value Object representing the pseudo-type 'never'.
* Value Object representing the return-type 'never'.
*
* Never is generally only used when working with return types as it signifies that the method that only
* ever throw or exit.
Expand Down
2 changes: 1 addition & 1 deletion src/Types/Void_.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use phpDocumentor\Reflection\Type;

/**
* Value Object representing the pseudo-type 'void'.
* Value Object representing the return-type 'void'.
*
* Void is generally only used when working with return types as it signifies that the method intentionally does not
* return any value.
Expand Down

0 comments on commit 4d427fa

Please sign in to comment.