Applications events sender
composer require arquivei/events-sender
Create your exporter and pass for Sender class
You can use the entities schemas:
<?php
$exporter = new \Arquivei\Events\Sender\Exporters\File('filePath');
$sender = new \Arquivei\Events\Sender\Sender($exporter);
/**
* @param \Arquivei\Events\Sender\Schemas\ClassicSchema $schema
* @param string $stream
*/
$sender->push($schema, $stream);
<?php
$exporter = new \Arquivei\Events\Sender\Exporters\File('filePath');
$sender = new \Arquivei\Events\Sender\Sender($exporter);
/**
* @param \Arquivei\Events\Sender\Schemas\LatestSchema $schema
* @param string $stream
*/
$sender->push($schema, $stream);
Or use the factories:
<?php
$exporter = new \Arquivei\Events\Sender\Exporters\File('filePath');
$sender = new \Arquivei\Events\Sender\Sender($exporter);
/**
* @param \Arquivei\Events\Sender\Factories\LatestSchemaFactory $schema
* @param string $stream
*/
$sender->push($schema, $stream);
<?php
$exporter = new \Arquivei\Events\Sender\Exporters\File('filePath');
$sender = new \Arquivei\Events\Sender\Sender($exporter);
/**
* @param \Arquivei\Events\Sender\Factories\ClassicSchemaFactory $schema
* @param string $stream
*/
$sender->push($schema, $stream);
- Pass your exporters in order to, if the first one fails, the second be called.
- To call only one exporter configure only one of them.
$ vendor/phpunit/phpunit/phpunit tests