first commit
This commit is contained in:
21
modules/ps_mbo/vendor/react/promise/tests/fixtures/SimpleFulfilledTestPromise.php
vendored
Normal file
21
modules/ps_mbo/vendor/react/promise/tests/fixtures/SimpleFulfilledTestPromise.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace React\Promise;
|
||||
|
||||
class SimpleFulfilledTestPromise implements PromiseInterface
|
||||
{
|
||||
public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null)
|
||||
{
|
||||
try {
|
||||
if ($onFulfilled) {
|
||||
$onFulfilled('foo');
|
||||
}
|
||||
|
||||
return new self();
|
||||
} catch (\Throwable $exception) {
|
||||
return new RejectedPromise($exception);
|
||||
} catch (\Exception $exception) {
|
||||
return new RejectedPromise($exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
21
modules/ps_mbo/vendor/react/promise/tests/fixtures/SimpleFulfilledTestThenable.php
vendored
Normal file
21
modules/ps_mbo/vendor/react/promise/tests/fixtures/SimpleFulfilledTestThenable.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace React\Promise;
|
||||
|
||||
class SimpleFulfilledTestThenable
|
||||
{
|
||||
public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null)
|
||||
{
|
||||
try {
|
||||
if ($onFulfilled) {
|
||||
$onFulfilled('foo');
|
||||
}
|
||||
|
||||
return new self();
|
||||
} catch (\Throwable $exception) {
|
||||
return new RejectedPromise($exception);
|
||||
} catch (\Exception $exception) {
|
||||
return new RejectedPromise($exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
21
modules/ps_mbo/vendor/react/promise/tests/fixtures/SimpleRejectedTestPromise.php
vendored
Normal file
21
modules/ps_mbo/vendor/react/promise/tests/fixtures/SimpleRejectedTestPromise.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace React\Promise;
|
||||
|
||||
class SimpleRejectedTestPromise implements PromiseInterface
|
||||
{
|
||||
public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null)
|
||||
{
|
||||
try {
|
||||
if ($onRejected) {
|
||||
$onRejected('foo');
|
||||
}
|
||||
|
||||
return new self();
|
||||
} catch (\Throwable $exception) {
|
||||
return new RejectedPromise($exception);
|
||||
} catch (\Exception $exception) {
|
||||
return new RejectedPromise($exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
13
modules/ps_mbo/vendor/react/promise/tests/fixtures/SimpleTestCancellable.php
vendored
Normal file
13
modules/ps_mbo/vendor/react/promise/tests/fixtures/SimpleTestCancellable.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace React\Promise;
|
||||
|
||||
class SimpleTestCancellable
|
||||
{
|
||||
public $cancelCalled = false;
|
||||
|
||||
public function cancel()
|
||||
{
|
||||
$this->cancelCalled = true;
|
||||
}
|
||||
}
|
||||
18
modules/ps_mbo/vendor/react/promise/tests/fixtures/SimpleTestCancellableThenable.php
vendored
Normal file
18
modules/ps_mbo/vendor/react/promise/tests/fixtures/SimpleTestCancellableThenable.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace React\Promise;
|
||||
|
||||
class SimpleTestCancellableThenable
|
||||
{
|
||||
public $cancelCalled = false;
|
||||
|
||||
public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null)
|
||||
{
|
||||
return new self();
|
||||
}
|
||||
|
||||
public function cancel()
|
||||
{
|
||||
$this->cancelCalled = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user