-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* extract looping mechanism in prompt * extract keypress looping mechanism in FakesInputOutput * add docblock with type * swap out `Nothing` class for proper `Result` sentinel class * formatting * swap out Closure for callable, add types * add documentation * add comment * move readonly keyword to property for php8.1 support
- Loading branch information
1 parent
fa9674f
commit fdc964d
Showing
3 changed files
with
67 additions
and
6 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
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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Laravel\Prompts\Support; | ||
|
||
/** | ||
* Result. | ||
* | ||
* This is a 'sentinel' value. It wraps a return value, which can | ||
* allow us to differentiate between a `null` return value and | ||
* a `null` return value that's intended to continue a loop. | ||
*/ | ||
final class Result | ||
{ | ||
public function __construct( | ||
public readonly mixed $value, | ||
) {} | ||
|
||
public static function from(mixed $value): self | ||
{ | ||
return new self($value); | ||
} | ||
} |