Skip to content

Commit db5b2c3

Browse files
committed
variable name change
1 parent 5fd2f59 commit db5b2c3

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/KeyEntityFormEnhancer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,10 @@ public function validateForm(array &$form, FormStateInterface $form_state): void
355355
}
356356

357357
// Data Residency check.
358-
\Drupal::state()->delete(DataResidencyEndpointInterface::ENDPOINT_KEY);
358+
\Drupal::state()->delete(DataResidencyEndpointInterface::DRZ_ENDPOINT);
359359
$key_value_array = json_decode($key_value, TRUE);
360360
if ($key_value_array['instance_type'] == EdgeKeyTypeInterface::INSTANCE_TYPE_HYBRID) {
361-
$this->dataResidencyEndpoint->discoverEndpoint($test_key);
361+
$this->dataResidencyEndpoint->getEndpoint($test_key);
362362
}
363363

364364
// Test the connection.

src/Plugin/EdgeKeyTypeBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function getAuthenticationType(KeyInterface $key): string {
7171
*/
7272
public function getEndpoint(KeyInterface $key): string {
7373
if ($this->getInstanceType($key) === EdgeKeyTypeInterface::INSTANCE_TYPE_HYBRID) {
74-
if ($endpoint = \Drupal::state()->get(DataResidencyEndpointInterface::ENDPOINT_KEY)) {
74+
if ($endpoint = \Drupal::state()->get(DataResidencyEndpointInterface::DRZ_ENDPOINT)) {
7575
return $endpoint;
7676
}
7777
return ClientInterface::APIGEE_ON_GCP_ENDPOINT;

src/Service/DataResidencyEndpoint.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function __construct(SDKConnectorInterface $sdk_connector, StateInterface
8585
/**
8686
* {@inheritdoc}
8787
*/
88-
public function discoverEndpoint(KeyInterface $key): void {
88+
public function getEndpoint(KeyInterface $key): void {
8989
/** @var \Drupal\apigee_edge\Plugin\KeyType\ApigeeAuthKeyType $key_type */
9090
$key_type = $key->getKeyType();
9191

@@ -99,17 +99,17 @@ public function discoverEndpoint(KeyInterface $key): void {
9999
if (isset($dataResidencyData['location']) && $dataResidencyData['location']) {
100100
$dataResidencyEndpoint = str_replace("https://", "https://{$dataResidencyData['location']}-", $base_endpoint);
101101

102-
$this->state->set(self::ENDPOINT_KEY, $dataResidencyEndpoint);
102+
$this->state->set(self::DRZ_ENDPOINT, $dataResidencyEndpoint);
103103
$this->messenger->addStatus($this->stringTranslation->translate('Data residency is enabled for this organization. Service endpoint being used is @serviceEndpoint', ['@serviceEndpoint' => $dataResidencyEndpoint]));
104104
}
105105
else {
106-
$this->state->delete(self::ENDPOINT_KEY);
106+
$this->state->delete(self::DRZ_ENDPOINT);
107107
}
108108
}
109109
catch (\Exception $e) {
110110
// We can ignore this exception, as it means that the data residency
111111
// endpoint could not be determined.
112-
$this->state->delete(self::ENDPOINT_KEY);
112+
$this->state->delete(self::DRZ_ENDPOINT);
113113
}
114114
}
115115

src/Service/DataResidencyEndpointInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ interface DataResidencyEndpointInterface {
3030
/**
3131
* The key used to store the endpoint in the state.
3232
*/
33-
public const ENDPOINT_KEY = 'drzendpoint';
33+
public const DRZ_ENDPOINT = 'drzendpoint';
3434

3535
/**
3636
* Discovers and stores the data residency endpoint for a given key.
3737
*
3838
* @param \Drupal\key\KeyInterface $key
3939
* The key to discover the endpoint for.
4040
*/
41-
public function discoverEndpoint(KeyInterface $key): void;
41+
public function getEndpoint(KeyInterface $key): void;
4242

4343
}

0 commit comments

Comments
 (0)