19 declare(strict_types=1);
41 $result = $transformation->transform([
'hello', 42]);
43 $this->assertEquals([
'hello', 42], $result);
48 $this->expectNotToPerformAssertions();
53 $object = $transformation->transform([
'hello',
'world']);
63 $this->expectNotToPerformAssertions();
67 }
catch (
Error $exception) {
76 $this->expectNotToPerformAssertions();
89 $this->expectNotToPerformAssertions();
94 $object = $transformation->transform([
'hello', 10]);
104 $this->expectNotToPerformAssertions();
108 $object = $transformation->applyTo(
new Ok([
'hello', 10]));
118 $this->expectNotToPerformAssertions();
123 $object = $transformation->transform([
'hello', 10]);
135 $object = $transformation->applyTo(
new Ok([
'hello', 10]));
137 $this->assertTrue($object->isError());
143 public function myMethod(
string $string,
int $integer): array
145 return [$string, $integer];
150 return [$string, $integer];
A result encapsulates a value or an error and simplifies the handling of those.