sensorario/biberon

There is no license information available for the latest version (v1.0.7) of this package.

v1.0.7 2018-09-30 20:30 UTC

This package is auto-updated.

Last update: 2024-10-05 05:22:21 UTC


README

Build Status

Example

biberon2.png

use Sensorario\Biberon\Biberon;
use Sensorario\Biberon\Detector;
use Sensorario\Biberon\Stat;

$show = new Sensorario\Biberon\Show(
    new Sensorario\Biberon\Detector(),
    (new Sensorario\Biberon\Stat())->init([
        'count' => 100,
        'columnsize' => 33,
    ])
);

while ($show->mustGoOn()) {
    $show->next(function() {
        return rand(11111, 99999);
    });
}

Change dot with letter and color output

biberon_microtime.png

use Sensorario\Biberon\Detector;

$detector = new Detector();
$detector->setColors([
    'B' => Detector::COLOR_GREEN,
    'p' => Detector::COLOR_RED,
    'L' => Detector::COLOR_VIOLET,
]);
$detector->addRules([
    'L' => function ($input) { return $input < 10000; },
    'B' => function ($input) { return $input > 70000; },
    'p' => function ($input) { return $input % 2 == 0; },
    'd' => function ($input) { return $input % 2 == 1; },
]);

$data = [];
for ($i = 0; $i < 666; $i++) {
    $data[] = rand(1, 99999);
}

$show = new Sensorario\Biberon\Show(
    $detector,
    (new Sensorario\Biberon\Stat())->init([
        'count' => count($data),
        'column' => 0,
        'print' => 0,
        'columnsize' => 48,
    ])
);

while ($show->mustGoOn()) {
    $show->next(function() {
        return rand(11111, 99999);
    });
}