3 declare(strict_types=1);
39 $object = $transformation->transform([
'hello', 42]);
41 $result = $object->myMethod();
43 $this->assertEquals([
'hello', 42], $result);
48 $this->expectNotToPerformAssertions();
53 $object = $transformation->transform([
'hello',
'world']);
68 $resultObject = $transformation->applyTo(
new Ok([
'hello', 42]));
70 $object = $resultObject->value();
72 $result = $object->myMethod();
74 $this->assertEquals([
'hello', 42], $result);
79 $this->expectNotToPerformAssertions();
84 $resultObject = $transformation->applyTo(
new Ok([
'hello',
'world']));
96 $resultObject = $transformation->applyTo(
new Ok([
'hello', 100]));
98 $this->assertTrue($resultObject->isError());
103 $this->expectNotToPerformAssertions();
108 $resultObject = $transformation->transform([
'hello', 100]);
124 $this->
string = $string;
125 $this->integer = $integer;
130 return [$this->string, $this->integer];
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A result encapsulates a value or an error and simplifies the handling of those.