init
This commit is contained in:
21
vendor/react/promise/tests/fixtures/SimpleFulfilledTestPromise.php
vendored
Executable file
21
vendor/react/promise/tests/fixtures/SimpleFulfilledTestPromise.php
vendored
Executable 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
vendor/react/promise/tests/fixtures/SimpleFulfilledTestThenable.php
vendored
Executable file
21
vendor/react/promise/tests/fixtures/SimpleFulfilledTestThenable.php
vendored
Executable 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
vendor/react/promise/tests/fixtures/SimpleRejectedTestPromise.php
vendored
Executable file
21
vendor/react/promise/tests/fixtures/SimpleRejectedTestPromise.php
vendored
Executable 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
vendor/react/promise/tests/fixtures/SimpleTestCancellable.php
vendored
Executable file
13
vendor/react/promise/tests/fixtures/SimpleTestCancellable.php
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace React\Promise;
|
||||
|
||||
class SimpleTestCancellable
|
||||
{
|
||||
public $cancelCalled = false;
|
||||
|
||||
public function cancel()
|
||||
{
|
||||
$this->cancelCalled = true;
|
||||
}
|
||||
}
|
||||
18
vendor/react/promise/tests/fixtures/SimpleTestCancellableThenable.php
vendored
Executable file
18
vendor/react/promise/tests/fixtures/SimpleTestCancellableThenable.php
vendored
Executable 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