PHP code example of zephyr-m / matrix-kernel
1. Go to this page and download the library: Download zephyr-m/matrix-kernel 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/ */
zephyr-m / matrix-kernel example snippets
use Zephyr\MatrixKernel\Kernel;
$k = new Kernel();
// resolve: применить шаблон к матрице
$result = $k->resolve($matrix, fn($m, $ctx, $k) => /* что угодно */, $ctx);
// hydrate: развернуть callable в данные
$data = $k->hydrate(['price' => fn($c, $k) => $c['ticker'] * $c['qty']], $ctx);