Skip to content

Commit

Permalink
remove event bus stack & some small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBadura committed Feb 7, 2024
1 parent 0aa0335 commit b4c1ec8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 40 deletions.
4 changes: 2 additions & 2 deletions src/Console/InvalidArgumentGiven.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use InvalidArgumentException;

use function gettype;
use function get_debug_type;
use function sprintf;

final class InvalidArgumentGiven extends InvalidArgumentException
Expand All @@ -19,7 +19,7 @@ public function __construct(
sprintf(
'Invalid argument given: need type "%s" got "%s"',
$need,
gettype($value),
get_debug_type($value),
),
);
}
Expand Down
30 changes: 0 additions & 30 deletions src/EventBus/EventBusStackBuilder.php

This file was deleted.

3 changes: 1 addition & 2 deletions src/Outbox/DoctrineOutboxStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ public function retrieveOutboxMessages(int|null $limit = null): array
function (array $data) {
$message = $this->messageSerializer->deserialize($data['message']);

return $message
->withCustomHeader(self::HEADER_OUTBOX_IDENTIFIER, $data['id']);
return $message->withCustomHeader(self::HEADER_OUTBOX_IDENTIFIER, $data['id']);
},
$result,
);
Expand Down
4 changes: 2 additions & 2 deletions src/Outbox/OutboxHeaderIssue.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use RuntimeException;

use function gettype;
use function get_debug_type;
use function sprintf;

final class OutboxHeaderIssue extends RuntimeException
Expand All @@ -18,6 +18,6 @@ public static function missingHeader(string $header): self

public static function invalidHeaderType(mixed $value): self
{
return new self(sprintf('Invalid header given: need type "int" got "%s"', gettype($value)));
return new self(sprintf('Invalid header given: need type "int" got "%s"', get_debug_type($value)));
}
}
8 changes: 4 additions & 4 deletions tests/Unit/Console/InputHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testValidString(): void
public function testInvalidString(): void
{
$this->expectException(InvalidArgumentGiven::class);
$this->expectExceptionMessage('Invalid argument given: need type "string" got "integer"');
$this->expectExceptionMessage('Invalid argument given: need type "string" got "int"');

InputHelper::string(1);
}
Expand All @@ -37,7 +37,7 @@ public function testValidNullableStringIsNull(): void
public function testInvalidNullableString(): void
{
$this->expectException(InvalidArgumentGiven::class);
$this->expectExceptionMessage('Invalid argument given: need type "string|null" got "integer"');
$this->expectExceptionMessage('Invalid argument given: need type "string|null" got "int"');

InputHelper::nullableString(1);
}
Expand All @@ -50,7 +50,7 @@ public function testValidBoolean(): void
public function testInvalidBoolean(): void
{
$this->expectException(InvalidArgumentGiven::class);
$this->expectExceptionMessage('Invalid argument given: need type "bool" got "integer"');
$this->expectExceptionMessage('Invalid argument given: need type "bool" got "int"');

InputHelper::bool(1);
}
Expand All @@ -68,7 +68,7 @@ public function testValidNullInt(): void
public function testInvalidInt(): void
{
$this->expectException(InvalidArgumentGiven::class);
$this->expectExceptionMessage('Invalid argument given: need type "int|null" got "boolean"');
$this->expectExceptionMessage('Invalid argument given: need type "int|null" got "bool"');

InputHelper::nullableInt(true);
}
Expand Down

0 comments on commit b4c1ec8

Please sign in to comment.