-
-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a return type using phpdoc to fix IDE autocomplete (#292)
The make function can't define a return type, because the result could be a Decorator, or the actual action. However, without docblocks or type-hinting, PHPStorm ends up providing incorrect autocomplete information. The solution is to instead add back a phpdoc comment for this specific use case. See #285 and #287 for more details.
- Loading branch information
1 parent
4507d5b
commit 5a168bf
Showing
2 changed files
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,9 @@ | |
|
||
trait AsObject | ||
{ | ||
/** | ||
* @return static | ||
*/ | ||
public static function make() | ||
{ | ||
return app(static::class); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters