Skip to content

Commit

Permalink
Rename QuantPurgeSettings to QuantPurgerSettings.
Browse files Browse the repository at this point in the history
  • Loading branch information
kepol committed Jul 6, 2024
1 parent 7fad3c0 commit d52e394
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* },
* )
*/
class QuantPurgeSettings extends PurgerSettingsBase implements PurgerSettingsInterface {
class QuantPurgerSettings extends PurgerSettingsBase implements PurgerSettingsInterface {

/**
* Instance metadata.
Expand Down
14 changes: 7 additions & 7 deletions modules/quant_purger/src/Form/QuantPurgeFormBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Drupal\Core\Form\FormStateInterface;
use Drupal\purge\Plugin\Purge\Invalidation\InvalidationsServiceInterface;
use Drupal\purge_ui\Form\PurgerConfigFormBase;
use Drupal\quant_purger\Entity\QuantPurgeSettings;
use Drupal\quant_purger\Entity\QuantPurgerSettings;
use Drupal\Core\Entity\EntityTypeManagerInterface;

/**
Expand Down Expand Up @@ -67,7 +67,7 @@ public function getFormId() {
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$settings = QuantPurgeSettings::load($this->getId($form_state));
$settings = QuantPurgerSettings::load($this->getId($form_state));
$form['tabs'] = ['#type' => 'vertical_tabs', '#weight' => 10];
$this->buildFormMetadata($form, $form_state, $settings);
$this->buildFormPerformance($form, $form_state, $settings);
Expand All @@ -81,10 +81,10 @@ public function buildForm(array $form, FormStateInterface $form_state) {
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
* @param \Drupal\quant_purger\Entity\QuantPurgeSettings $settings
* @param \Drupal\quant_purger\Entity\QuantPurgerSettings $settings
* Configuration entity for the purger being configured.
*/
public function buildFormMetadata(array &$form, FormStateInterface $form_state, QuantPurgeSettings $settings) {
public function buildFormMetadata(array &$form, FormStateInterface $form_state, QuantPurgerSettings $settings) {
$form['name'] = [
'#title' => $this->t('Name'),
'#type' => 'textfield',
Expand All @@ -105,10 +105,10 @@ public function buildFormMetadata(array &$form, FormStateInterface $form_state,
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
* @param \Drupal\quant_purger\Entity\QuantPurgeSettings $settings
* @param \Drupal\quant_purger\Entity\QuantPurgerSettings $settings
* Configuration entity for the purger being configured.
*/
public function buildFormPerformance(array &$form, FormStateInterface $form_state, QuantPurgeSettings $settings) {
public function buildFormPerformance(array &$form, FormStateInterface $form_state, QuantPurgerSettings $settings) {
$form['performance'] = [
'#type' => 'details',
'#group' => 'tabs',
Expand Down Expand Up @@ -201,7 +201,7 @@ public function validateForm(array &$form, FormStateInterface $form_state) {
* {@inheritdoc}
*/
public function submitFormSuccess(array &$form, FormStateInterface $form_state) {
$settings = QuantPurgeSettings::load($this->getId($form_state));
$settings = QuantPurgerSettings::load($this->getId($form_state));

// Iterate the config object and overwrite values found in the form state.
foreach ($settings as $key => $default_value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use GuzzleHttp\ClientInterface;
use Drupal\purge\Plugin\Purge\Purger\PurgerBase;
use Drupal\purge\Plugin\Purge\Purger\PurgerInterface;
use Drupal\quant_purger\Entity\QuantPurgeSettings;
use Drupal\quant_purger\Entity\QuantPurgerSettings;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\purge\Plugin\Purge\Invalidation\InvalidationInterface;

Expand All @@ -25,7 +25,7 @@ abstract class QuantPurgeBase extends PurgerBase implements PurgerInterface {
/**
* The settings entity holding all configuration.
*
* @var \Drupal\quant_purger\Entity\QuantPurgeSettings
* @var \Drupal\quant_purger\Entity\QuantPurgerSettings
*/
protected $settings;

Expand All @@ -52,7 +52,7 @@ abstract class QuantPurgeBase extends PurgerBase implements PurgerInterface {
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, ClientInterface $http_client, Token $token) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->settings = QuantPurgeSettings::load($this->getId());
$this->settings = QuantPurgerSettings::load($this->getId());
// Note: We use the Quant HTTP client rather than the generic Guzzle client.
$this->client = \Drupal::service('quant_api.client');
$this->token = $token;
Expand All @@ -75,7 +75,7 @@ public static function create(ContainerInterface $container, array $configuratio
* {@inheritdoc}
*/
public function delete() {
QuantPurgeSettings::load($this->getId())->delete();
QuantPurgerSettings::load($this->getId())->delete();
}

/**
Expand Down

0 comments on commit d52e394

Please sign in to comment.