Skip to content

Commit

Permalink
Rename errorsUrl method and memoization property for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
asgrim committed Jan 11, 2022
1 parent 5948dd1 commit 727ce10
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Errors/ScoutClient/HttpErrorReportingClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ final class HttpErrorReportingClient implements ErrorReportingClient
/** @var FindApplicationRoot */
private $findApplicationRoot;
/** @var string|null */
private $memoizedErrorsUrl;
private $memoizedErrorReportingServiceUrl;
/** @var Superglobals */
private $superglobals;
/** @var DetermineHostname */
Expand Down Expand Up @@ -111,13 +111,13 @@ public function sendErrorToScout(array $errorEvents): void
));
}

private function memoizedErrorsUrl(): string
private function errorReportingServiceUrl(): string
{
if ($this->memoizedErrorsUrl === null) {
$this->memoizedErrorsUrl = rtrim((string) $this->config->get(ConfigKey::ERRORS_HOST), '/') . self::SCOUT_REPORTING_PATH;
if ($this->memoizedErrorReportingServiceUrl === null) {
$this->memoizedErrorReportingServiceUrl = rtrim((string) $this->config->get(ConfigKey::ERRORS_HOST), '/') . self::SCOUT_REPORTING_PATH;
}

return $this->memoizedErrorsUrl;
return $this->memoizedErrorReportingServiceUrl;
}

/**
Expand All @@ -128,7 +128,7 @@ private function psrRequestFromEvents(array $errorEvent): RequestInterface
return $this->requestFactory
->createRequest(
'POST',
$this->memoizedErrorsUrl() . '?' . http_build_query([
$this->errorReportingServiceUrl() . '?' . http_build_query([
'key' => $this->config->get(ConfigKey::APPLICATION_KEY),
'name' => $this->config->get(ConfigKey::APPLICATION_NAME),
])
Expand Down

0 comments on commit 727ce10

Please sign in to comment.