refactor: apply rector
Some checks are pending
tests / ci (push) Waiting to run

This commit is contained in:
Benjamin Nussbaum 2025-09-24 20:31:32 +02:00
parent c67a182cf2
commit b4b6286172
89 changed files with 672 additions and 666 deletions

View file

@ -4,26 +4,26 @@ declare(strict_types=1);
use App\Notifications\Messages\WebhookMessage;
test('webhook message can be created with static method', function () {
test('webhook message can be created with static method', function (): void {
$message = WebhookMessage::create('test data');
expect($message)->toBeInstanceOf(WebhookMessage::class);
});
test('webhook message can be created with constructor', function () {
test('webhook message can be created with constructor', function (): void {
$message = new WebhookMessage('test data');
expect($message)->toBeInstanceOf(WebhookMessage::class);
});
test('webhook message can set query parameters', function () {
test('webhook message can set query parameters', function (): void {
$message = WebhookMessage::create()
->query(['param1' => 'value1', 'param2' => 'value2']);
expect($message->toArray()['query'])->toBe(['param1' => 'value1', 'param2' => 'value2']);
});
test('webhook message can set data', function () {
test('webhook message can set data', function (): void {
$data = ['key' => 'value', 'nested' => ['array' => 'data']];
$message = WebhookMessage::create()
->data($data);
@ -31,7 +31,7 @@ test('webhook message can set data', function () {
expect($message->toArray()['data'])->toBe($data);
});
test('webhook message can add headers', function () {
test('webhook message can add headers', function (): void {
$message = WebhookMessage::create()
->header('X-Custom-Header', 'custom-value')
->header('Authorization', 'Bearer token');
@ -41,7 +41,7 @@ test('webhook message can add headers', function () {
expect($headers['Authorization'])->toBe('Bearer token');
});
test('webhook message can set user agent', function () {
test('webhook message can set user agent', function (): void {
$message = WebhookMessage::create()
->userAgent('Test App/1.0');
@ -49,20 +49,20 @@ test('webhook message can set user agent', function () {
expect($headers['User-Agent'])->toBe('Test App/1.0');
});
test('webhook message can set verify option', function () {
test('webhook message can set verify option', function (): void {
$message = WebhookMessage::create()
->verify(true);
expect($message->toArray()['verify'])->toBeTrue();
});
test('webhook message verify defaults to false', function () {
test('webhook message verify defaults to false', function (): void {
$message = WebhookMessage::create();
expect($message->toArray()['verify'])->toBeFalse();
});
test('webhook message can chain methods', function () {
test('webhook message can chain methods', function (): void {
$message = WebhookMessage::create(['initial' => 'data'])
->query(['param' => 'value'])
->data(['updated' => 'data'])
@ -79,7 +79,7 @@ test('webhook message can chain methods', function () {
expect($array['verify'])->toBeTrue();
});
test('webhook message toArray returns correct structure', function () {
test('webhook message toArray returns correct structure', function (): void {
$message = WebhookMessage::create(['test' => 'data']);
$array = $message->toArray();