3declare(strict_types=1);
 
   30use UnexpectedValueException;
 
   43        $result = $parallel->transform(
'hello');
 
   45        $this->assertEquals([
'hello', 
'hello'], $result);
 
   58        $result = $parallel->applyTo(
new Ok(
'hello'));
 
   60        $this->assertEquals([
'hello', 
'hello'], $result->value());
 
   65        $this->expectNotToPerformAssertions();
 
   69            $result = $parallel->transform(42.0);
 
   70        } 
catch (UnexpectedValueException $exception) {
 
   87        $result = $parallel->applyTo(
new Ok(42));
 
   89        $this->assertTrue($result->isError());
 
   94        $this->expectNotToPerformAssertions();
 
A result encapsulates a value or an error and simplifies the handling of those.