Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Fix static analysis issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ts-navghane committed Jul 17, 2023
1 parent 9b7e499 commit b7489b0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
4 changes: 2 additions & 2 deletions EventSubscriber/CallbackSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function processCallbackRequest(TransportWebhookEvent $event): void
}

/**
* @param string $hashId
* @param string $hashId
* @param array<mixed> $event
*/
private function processCallbackByHashId($hashId, array $event): void
Expand Down Expand Up @@ -94,7 +94,7 @@ private function processCallbackByHashId($hashId, array $event): void
}

/**
* @param string $email
* @param string $email
* @param array<mixed> $event
*/
private function processCallbackByEmailAddress($email, array $event): void
Expand Down
2 changes: 1 addition & 1 deletion Mailer/Factory/SparkpostTransportFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
class SparkpostTransportFactory extends AbstractTransportFactory
{
public function __construct(
EventDispatcherInterface $eventDispatcher,
private TransportCallback $transportCallback,
EventDispatcherInterface $eventDispatcher,
HttpClientInterface $client = null,
LoggerInterface $logger = null
) {
Expand Down
24 changes: 24 additions & 0 deletions Mailer/Transport/SparkpostTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ private function buildAttachments(MauticMessage $message): array
}

/**
* @param array<mixed> $metadata
* @param array<mixed> $mergeVars
*
* @return array<mixed>
*/
private function buildRecipients(MauticMessage $message, array $metadata, array $mergeVars): array
Expand All @@ -235,6 +238,9 @@ private function buildRecipients(MauticMessage $message, array $metadata, array
}

/**
* @param array<mixed> $metadata
* @param array<mixed> $mergeVars
*
* @return array<mixed>
*/
private function buildRecipient(Address $to, array $metadata, array $mergeVars): array
Expand Down Expand Up @@ -277,6 +283,8 @@ private function buildRecipient(Address $to, array $metadata, array $mergeVars):
}

/**
* @param array<mixed> $recipient
*
* @return array<mixed>
*/
private function buildCopyRecipient(Address $to, Address $copy, array $recipient): array
Expand All @@ -293,6 +301,10 @@ private function buildCopyRecipient(Address $to, Address $copy, array $recipient
return $copyRecipient;
}

/**
* @param array<mixed> $metadata
* @param array<mixed> $metadataSet
*/
private function getCampaignId(array $metadata, array $metadataSet): string
{
$campaignId = '';
Expand All @@ -315,6 +327,8 @@ private function getCampaignId(array $metadata, array $metadataSet): string
}

/**
* @param array<mixed> $payload
*
* @throws ClientExceptionInterface
* @throws RedirectionExceptionInterface
* @throws ServerExceptionInterface
Expand Down Expand Up @@ -345,6 +359,8 @@ private function checkTemplateIsValid(array $payload): void
}

/**
* @param array<mixed> $payload
*
* @throws TransportExceptionInterface
*/
private function getSparkpostResponse(
Expand Down Expand Up @@ -383,11 +399,19 @@ private function handleError(ResponseInterface $response): void
throw new HttpTransportException(json_encode($data['errors']), $response, $response->getStatusCode());
}

/**
* @param array<mixed> $response
*/
private function getErrorMessageFromResponseBody(array $response): string
{
return $response['errors'][0]['description'] ?? $response['errors'][0]['message'] ?? '';
}

/**
* @param array<mixed> $message
* @param array<mixed> $response
* @param array<mixed> $metadata
*/
private function processImmediateSendFeedback(array $message, array $response, array $metadata): void
{
if (!empty($response['errors'][0]['code']) && 1902 === (int) $response['errors'][0]['code']) {
Expand Down

0 comments on commit b7489b0

Please sign in to comment.