mshumakov/decomposer

This package is abandoned and no longer maintained. No replacement package was suggested.

Separation of a large piece of data into controlled fragments.

v3.1 2020-06-10 19:49 UTC

This package is auto-updated.

Last update: 2021-03-11 06:31:22 UTC


README

start with why build Codacy Badge Codacy Badge

This package is for big data fragmentation.

Installation

To install, download the package using the following command.

composer require mshumakov/decomposer

Example

A basic example of using a package to break data into fragments.

<?php
declare(strict_types=1);

use MSdev\Helper\Decomposer;

require __DIR__ . '/../vendor/autoload.php';

$data = [
    [...],
    [...],
    [...],
];

$batchSize = 10; // Fragment size
$totalCount = count($data); // Total amount of data
$params = [
    'hello' => 'world'
];

/**
 * In the response, we return the passed parameters 
 * ($params) and a list of fragments (key - 'list').
 * 
 * p.s.: More information in the tests.
 */
$decomposer = new Decomposer();
$fragments = $decomposer->decompose(
    $batchSize, 
    $totalCount,
    $params
);