weby sloth
1.0.0
Diese PHP -Bibliothek bietet einfache Datenmanipulaton -Tools und kann für einfache Datenanalysen, Transformation und Berichterstattung verwendet werden. Beispielsweise liefert es Operationen für Eingabedaten als "Gruppe", "Pivot" und zusätzliche Gesamtfunktionen, die auf diese Vorgänge angewendet werden können.
composer require weby/sloth:v0.1Weitere Informationen finden Sie unter Beispiele Ordner.
// examples/data.php:
$ data = [
[ ' foo ' => ' one ' , ' bar ' => ' A ' , ' baz ' => 1 ],
[ ' foo ' => ' one ' , ' bar ' => ' B ' , ' baz ' => 2 ],
[ ' foo ' => ' one ' , ' bar ' => ' C ' , ' baz ' => 3 ],
[ ' foo ' => ' two ' , ' bar ' => ' A ' , ' baz ' => 4 ],
[ ' foo ' => ' two ' , ' bar ' => ' B ' , ' baz ' => 5 ],
[ ' foo ' => ' two ' , ' bar ' => ' C ' , ' baz ' => 6 ],
]; // examples/group.php:
require_once ' ../vendor/autoload.php ' ;
use Weby Sloth Sloth ;
include_once ' data.php ' ;
Sloth:: from ( $ data )
-> group ( ' foo ' , ' baz ' )
-> count ()
-> sum ()
-> avg ()
-> print ();
// Outputs:
// foo count sum avg
// one 3 6 2
// two 3 15 5 // examples/pivot.php:
require_once ' ../vendor/autoload.php ' ;
use Weby Sloth Sloth ;
include_once ' data.php ' ;
Sloth:: from ( $ data )
-> pivot ( ' foo ' , ' bar ' , ' baz ' )
-> print ();
// Outputs:
// foo A B C
// one 1 2 3
// two 4 5 6 Das Ausführen der Tests ist einfach:
vendor/bin/phpunitDie Dokumentation befindet sich im Wiki dieses Repos.
Weby Sloth wird unter der MIT -Lizenz verteilt.