Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
trejjam committed Mar 23, 2020
1 parent c8a6a76 commit 667c6e5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions src/DI/MailChimpExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function __construct()
public function getConfigSchema() : Schema
{
return Expect::from($this->config)->before(
function (array $config) : array {
function (array $config) : array {
if (true === ($config['findDataCenter'] ?? $this->config->findDataCenter)) {
// unable to find, possible use of neon parameter, which will be expanded later
$config['apiUrl'] = $this->config->apiUrlTemplate;
Expand Down Expand Up @@ -113,7 +113,7 @@ public function loadConfiguration(bool $validateConfig = true) : void

if ($this->config->findDataCenter === true) {
$accountDataCenter = Strings::match($this->config->apiKey, '~-(us(?:\d+))$~');
assert($accountDataCenter !== null);
assert($accountDataCenter !== null);
$this->config->apiUrl = sprintf($this->config->apiUrlTemplate, $accountDataCenter[1], MailChimp\Request::VERSION);
}

Expand Down
46 changes: 23 additions & 23 deletions src/Group/Lists.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,25 +192,25 @@ public function removeMember(MemberItem $memberItem) : ?array
}
}

/**
* @throws JsonException
* @throws MemberNotFoundException
* @throws RequestException
*/
public function removePermanentMember(MemberItem $memberItem) : ?array
{
try {
return $this->apiRequest->post($this->getDeleteOneMemberPermanentEndpointPath($memberItem->list_id, $memberItem->id), []);
} catch (ClientException $clientException) {
throw new MemberNotFoundException("Member '{$memberItem->id}' not found in the list '{$memberItem->list_id}'", $clientException);
} catch (RequestException $requestException) {
if ($requestException->getCode() === 204) {
return null;
}

throw $requestException;
}
}
/**
* @throws JsonException
* @throws MemberNotFoundException
* @throws RequestException
*/
public function removePermanentMember(MemberItem $memberItem) : ?array
{
try {
return $this->apiRequest->post($this->getDeleteOneMemberPermanentEndpointPath($memberItem->list_id, $memberItem->id), []);
} catch (ClientException $clientException) {
throw new MemberNotFoundException("Member '{$memberItem->id}' not found in the list '{$memberItem->list_id}'", $clientException);
} catch (RequestException $requestException) {
if ($requestException->getCode() === 204) {
return null;
}

throw $requestException;
}
}

/**
* @throws JsonException
Expand Down Expand Up @@ -329,10 +329,10 @@ private function getOneMemberEndpointPath(string $listId, string $memberHash) :
return $this->getMemberEndpointPath($listId) . "/{$memberHash}";
}

private function getDeleteOneMemberPermanentEndpointPath(string $listId, string $memberHash) : string
{
return $this->getOneMemberEndpointPath($listId, $memberHash) . "/actions/delete-permanent";
}
private function getDeleteOneMemberPermanentEndpointPath(string $listId, string $memberHash) : string
{
return $this->getOneMemberEndpointPath($listId, $memberHash) . '/actions/delete-permanent';
}

private function getSegmentEndpointPath(string $listId) : string
{
Expand Down

0 comments on commit 667c6e5

Please sign in to comment.