Skip to content

Commit

Permalink
chore(sender): rename raw sender to file-body
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk committed Jun 14, 2024
1 parent 29ed5aa commit eb03198
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Command/Run.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public function createRegistry(OutputInterface $output): Sender\SenderRegistry
{
$registry = new Sender\SenderRegistry();
$registry->register('console', Sender\ConsoleSender::create($output));
$registry->register('file', new Sender\FileSender());
$registry->register('raw', new Sender\RawFileSender());
$registry->register('file', new Sender\EventsToFileSender());
$registry->register('file-body', new Sender\BodyToFileSender());

Check warning on line 84 in src/Command/Run.php

View check run for this annotation

Codecov / codecov/patch

src/Command/Run.php#L83-L84

Added lines #L83 - L84 were not covered by tests
$registry->register(
'server',
new Sender\RemoteSender(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@
use Nyholm\Psr7\Stream;

/**
* Sends event body stream to file if possible.
* It creates a new file for each frame.
*
* @internal
*/
class RawFileSender implements Sender
class BodyToFileSender implements Sender
{
private readonly string $path;

public function __construct(

Check warning on line 22 in src/Sender/BodyToFileSender.php

View check run for this annotation

Codecov / codecov/patch

src/Sender/BodyToFileSender.php#L22

Added line #L22 was not covered by tests
string $path = 'runtime/raw',
string $path = 'runtime/body',
) {
$this->path = \rtrim($path, '/\\');
if (!\is_dir($path) && !\mkdir($path, 0o777, true) && !\is_dir($path)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
use Buggregator\Trap\Sender;

/**
* Store event groups to files.
* JSON format is used for serialization of each event.
*
* @internal
*/
class FileSender implements Sender
class EventsToFileSender implements Sender
{
private readonly string $path;

Expand Down

0 comments on commit eb03198

Please sign in to comment.