Skip to content

Commit

Permalink
fixup & lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pwtyler committed Nov 12, 2024
1 parent 2e324de commit 23a7e20
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/Plugin/SolrConnector/PantheonSolrConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public static function getPlatformConfig() {
'path' => getenv('PANTHEON_INDEX_PATH'),
'core' => getenv('PANTHEON_INDEX_CORE'),
'schema' => getenv('PANTHEON_INDEX_SCHEMA'),
'reload_path' => getenv('PANTHEON_INDEX_RELOAD_PATH')
'reload_path' => getenv('PANTHEON_INDEX_RELOAD_PATH'),
];
}

Expand Down
4 changes: 2 additions & 2 deletions src/Services/Endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ public function getReloadUri(): string {
}

/**
* Get the path for Schema Reloads
*
* Get the path for Schema Reloads.
*
* @return string
* The path for schema reloads
**/
Expand Down
19 changes: 8 additions & 11 deletions src/Services/SchemaPoster.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,16 @@ protected function reloadServer(): void {
$response = $this->getClient()->sendRequest($request);

$status_code = $response->getStatusCode();
$status_logger_content = [
'status_code' => $response->getStatusCode(),
'reason' => $response->getReasonPhrase(),
];
if ($status_code >= 200 && $status_code < 300) {
$this->logger->info('Server reloaded: {status_code} {reason}', [
'status_code' => $response->getStatusCode(),
'reason' => $response->getReasonPhrase(),
]);
}
else {
$this->logger->error('Server not reloaded: {status_code} {reason}', [
'status_code' => $response->getStatusCode(),
'reason' => $response->getReasonPhrase(),
]);
throw new PantheonSearchApiException('Server not reloaded.');
$this->logger->info('Server reloaded: {status_code} {reason}', $status_logger_content);
return;
}
$this->logger->error('Server not reloaded: {status_code} {reason}', $status_logger_content);
throw new PantheonSearchApiException('Server not reloaded.');
}

/**
Expand Down
5 changes: 3 additions & 2 deletions tests/Unit/EndpointServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public function testURIGeneration() {
}

public function testReloadPath() {
$ep = new Endpoint(["reload_path"=>"/reload"]);
$this->assertEquals("/reload", $ep->getReloadPath());
$ep = new Endpoint(["reload_path" => "/reload"]);
$this->assertEquals("/reload", $ep->getReloadPath());
}

}
4 changes: 2 additions & 2 deletions tests/Unit/GuzzleClassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
* @package \Drupal\search_api_pantheon
*/
class GuzzleClassTest extends TestCase {

protected $loggerFactory;

/**
* {@inheritdoc}
*/
Expand Down

0 comments on commit 23a7e20

Please sign in to comment.