PHP code example of touta / aria-runtime-php
1. Go to this page and download the library: Download touta/aria-runtime-php library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
touta / aria-runtime-php example snippets
use Touta\Aria\Runtime\Result;
use Touta\Aria\Runtime\Success;
use Touta\Aria\Runtime\StructuredFailure;
$result = Success::of(42);
$mapped = $result->map(fn(int $v) => $v * 2); // Success(84)
$failure = Result::failure(new StructuredFailure('NOT_FOUND', 'Resource not found'));
$recovered = $failure->recover(fn($e) => 'default'); // Success('default')
bash
composer