One Hat Cyber Team
Your IP :
216.73.216.187
Server IP :
178.63.234.5
Server :
Linux whm01.ins-jo.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Server Software :
Apache
PHP Version :
8.1.32
Buat File
|
Buat Folder
Dir :
~
/
home
/
business
/
www
/
vendor
/
php-http
/
promise
/
src
/
Edit File Name :
FulfilledPromise.php
<?php namespace Http\Promise; /** * A promise already fulfilled. * * @author Joel Wurtz <joel.wurtz@gmail.com> * * @template-covariant T * * @implements Promise<T> */ final class FulfilledPromise implements Promise { /** * @var T */ private $result; /** * @param T $result */ public function __construct($result) { $this->result = $result; } /** * {@inheritdoc} */ public function then(callable $onFulfilled = null, callable $onRejected = null) { if (null === $onFulfilled) { return $this; } try { return new self($onFulfilled($this->result)); } catch (\Exception $e) { return new RejectedPromise($e); } } /** * {@inheritdoc} */ public function getState() { return Promise::FULFILLED; } /** * {@inheritdoc} */ public function wait($unwrap = true) { if ($unwrap) { return $this->result; } } }
Save