Skip to content

Commit 6867624

Browse files
committed
3782: Clean up
1 parent 06ce6ee commit 6867624

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

src/Element/NetsEasyPaymentElement.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
namespace Drupal\os2forms_payment\Element;
44

5-
use Drupal\Core\Render\Element\FormElement;
5+
use Drupal\Core\Render\Element\FormElementBase;
66

77
/**
88
* Provides an OS2forms payment element'.
99
*
1010
* @FormElement("os2forms_payment_nets_easy_payment")
1111
*/
12-
class NetsEasyPaymentElement extends FormElement {
12+
class NetsEasyPaymentElement extends FormElementBase {
1313

1414
/**
1515
* {@inheritdoc}

src/Helper/PaymentHelper.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function webformSubmissionPresave(WebFormSubmissionInterface $submission)
106106
* The key of the payment object to update.
107107
* @param mixed|null $value
108108
* The value to set for the payment object key.
109-
* @param array|null $paymentObject
109+
* @param array<mixed>|null $paymentObject
110110
* The payment object to replace the existing with.
111111
*/
112112
public function updateWebformSubmissionPaymentObject(WebformSubmissionInterface $webformSubmission, ?string $key = NULL, mixed $value = NULL, ?array $paymentObject = NULL): WebformSubmissionInterface {
@@ -153,7 +153,7 @@ private function findPaymentElementKey(WebformSubmissionInterface $submission):
153153
* @param \Drupal\webform\WebformSubmissionInterface $submission
154154
* The webform submission.
155155
*
156-
* @return array
156+
* @return array<string, mixed>
157157
* An array containing the payment element and its machine name.
158158
*/
159159
private function getWebformElementNames(WebformSubmissionInterface $submission): array {
@@ -208,9 +208,9 @@ public function webformSubmissionInsert(WebFormSubmissionInterface $submission):
208208
$request = $this->requestStack->getCurrentRequest();
209209
$paymentId = $request->request->get('os2forms_payment_reference_field');
210210

211-
/** @var \Drupal\advancedqueue\Entity\Queue $queue */
211+
/** @var \Drupal\advancedqueue\Entity\Queue|NULL $queue */
212212
$queue = $this->getQueue();
213-
if (!$queue) {
213+
if (is_null($queue)) {
214214
throw new Exception(sprintf('Queue with ID %s does not exist.', $this->queueId));
215215
}
216216
$job = Job::create(NetsEasyPaymentHandler::class, [
@@ -450,7 +450,7 @@ public function getAmountToPayTemp(): float {
450450
* The HTTP method for the request.
451451
* @param string $endpoint
452452
* The endpoint URL.
453-
* @param array $params
453+
* @param array<mixed> $params
454454
* Optional. An associative array of parameters
455455
* to be sent in the request body.
456456
*

src/Plugin/AdvancedQueue/JobType/NetsEasyPaymentHandler.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ final class NetsEasyPaymentHandler extends JobTypeBase implements ContainerFacto
2727

2828
/**
2929
* {@inheritdoc}
30+
*
31+
* @param array<mixed> $configuration
3032
*/
3133
public function __construct(
3234
array $configuration,
@@ -41,6 +43,8 @@ public function __construct(
4143

4244
/**
4345
* {@inheritdoc}
46+
*
47+
* @param array<mixed> $configuration
4448
*/
4549
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
4650
return new NetsEasyPaymentHandler(
@@ -67,7 +71,7 @@ public function process(Job $job): JobResult {
6771
$payload = $job->getPayload();
6872
$stage = $payload['processing_stage'] ?? 0;
6973

70-
/** @var \Drupal\webform\Entity\WebformSubmissionInterface $webformSubmission */
74+
/** @var \Drupal\webform\WebformSubmissionInterface $webformSubmission */
7175
$webformSubmission = WebformSubmission::load($payload['submissionId']);
7276

7377
$logger_context = [
@@ -107,9 +111,9 @@ public function process(Job $job): JobResult {
107111
*
108112
* @param \Drupal\advancedqueue\Job $job
109113
* The job object containing payload information.
110-
* @param \Drupal\webform\Entity\WebformSubmissionInterface $webformSubmission
114+
* @param \Drupal\webform\WebformSubmissionInterface $webformSubmission
111115
* The webform submission related to the payment.
112-
* @param array $logger_context
116+
* @param array<mixed> $logger_context
113117
* Context for logging.
114118
*
115119
* @throws \Drupal\os2forms_payment\Exception\RuntimeException
@@ -161,9 +165,9 @@ private function getPaymentAndSetRelevantValues(Job $job, WebformSubmissionInter
161165
*
162166
* @param \Drupal\advancedqueue\Job $job
163167
* The job object containing payload information.
164-
* @param \Drupal\webform\Entity\WebformSubmissionInterface $webformSubmission
168+
* @param \Drupal\webform\WebformSubmissionInterface $webformSubmission
165169
* The webform submission related to the payment.
166-
* @param array $logger_context
170+
* @param array<mixed> $logger_context
167171
* Context for logging.
168172
*
169173
* @throws \Drupal\os2forms_payment\Exception\RuntimeException
@@ -199,9 +203,9 @@ private function updatePaymentReference(Job $job, WebformSubmissionInterface $we
199203
*
200204
* @param \Drupal\advancedqueue\Job $job
201205
* The job object containing payload information.
202-
* @param \Drupal\webform\Entity\WebformSubmissionInterface $webformSubmission
206+
* @param \Drupal\webform\WebformSubmissionInterface $webformSubmission
203207
* The webform submission related to the payment.
204-
* @param array $logger_context
208+
* @param array<mixed> $logger_context
205209
* Context for logging.
206210
*
207211
* @throws \Exception

0 commit comments

Comments
 (0)