https://github.com/sensorario/biberon
https://github.com/sensorario/biberon
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sensorario/biberon
- Owner: sensorario
- Created: 2018-09-30T06:45:07.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-04T16:12:39.000Z (over 7 years ago)
- Last Synced: 2025-12-30T19:43:49.018Z (6 months ago)
- Language: PHP
- Size: 781 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Biberon
[](https://travis-ci.org/sensorario/biberon)
## Example

```php
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

```php
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);
});
}
```