mirror of
https://github.com/danog/amp.git
synced 2024-12-13 09:57:25 +01:00
d496c9db24
A suggested alternative to resolving with [$yieldedValue] since static analysis (specifically Psalm) doesn't play well with that API. Will revert if Psalm changes or we decide to resolve with [$yieldedValue] anyway.
29 lines
370 B
PHP
29 lines
370 B
PHP
<?php
|
|
|
|
namespace Amp;
|
|
|
|
/**
|
|
* @template-covariant TValue
|
|
*/
|
|
final class YieldedValue
|
|
{
|
|
/** @var TValue */
|
|
private $value;
|
|
|
|
/**
|
|
* @param TValue $value
|
|
*/
|
|
public function __construct($value)
|
|
{
|
|
$this->value = $value;
|
|
}
|
|
|
|
/**
|
|
* @return TValue
|
|
*/
|
|
public function unwrap()
|
|
{
|
|
return $this->value;
|
|
}
|
|
}
|