Skip to content

Commit 3130081

Browse files
committed
OS-110 phpcs formatting
1 parent 9abfcbd commit 3130081

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

modules/os2forms_attachment/src/Element/AttachmentElement.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Drupal\os2forms_attachment\Element;
44

5-
use Drupal\Core\File\FileSystemInterface;
65
use Drupal\webform\Entity\WebformSubmission;
76
use Drupal\webform\WebformSubmissionInterface;
87
use Drupal\webform_attachment\Element\WebformAttachmentBase;
@@ -76,7 +75,7 @@ public static function getFileContent(array $element, WebformSubmissionInterface
7675
// Save printable document.
7776
$print_engine = $print_engine_manager->createSelectedInstance($element['#export_type']);
7877

79-
// Adding digital signature
78+
// Adding digital signature.
8079
if (isset($element['#digital_signature']) && $element['#digital_signature']) {
8180
$file_path = $print_builder->savePrintableDigitalSignature([$webform_submission], $print_engine, $scheme, $file_name);
8281
}

modules/os2forms_attachment/src/Os2formsAttachmentPrintBuilder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public function printHtml(EntityInterface $entity, $use_default_css = TRUE, $opt
3333
/**
3434
* Modified version of the original savePrintable() function.
3535
*
36-
* The only difference is modified call to prepareRenderer with digitalPost flag
37-
* TRUE.
36+
* The only difference is modified call to prepareRenderer with digitalPost
37+
* flag TRUE.
3838
*
3939
* @see PrintBuilder::savePrintable()
4040
*
@@ -65,8 +65,6 @@ public function savePrintableDigitalSignature(array $entities, PrintEngineInterf
6565
/**
6666
* Override prepareRenderer() the print engine with the passed entities.
6767
*
68-
* @see PrintBuilder::prepareRenderer
69-
*
7068
* @param array $entities
7169
* An array of entities.
7270
* @param \Drupal\entity_print\Plugin\PrintEngineInterface $print_engine
@@ -78,8 +76,10 @@ public function savePrintableDigitalSignature(array $entities, PrintEngineInterf
7876
*
7977
* @return \Drupal\entity_print\Renderer\RendererInterface
8078
* A print renderer.
79+
*
80+
* @see PrintBuilder::prepareRenderer
8181
*/
82-
protected function prepareRenderer(array $entities, PrintEngineInterface $print_engine, $use_default_css, $digitalSignature = false) {
82+
protected function prepareRenderer(array $entities, PrintEngineInterface $print_engine, $use_default_css, $digitalSignature = FALSE) {
8383
if (empty($entities)) {
8484
throw new \InvalidArgumentException('You must pass at least 1 entity');
8585
}

modules/os2forms_digital_signature/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ URL: `admin/os2forms_digital_signature/settings`
2929

3030
- **Signature server URL**
3131

32-
The URL of the service providing digital signature. This is the example of a known service https://signering.bellcom.dk/sign.php?
32+
The URL of the service providing digital signature. This is the example of a known service [https://signering.bellcom.dk/sign.php?](https://signering.bellcom.dk/sign.php?)
3333

3434
- **Hash Salt used for signature**
3535

modules/os2forms_digital_signature/os2forms_digital_signature.services.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ services:
77
class: Drupal\os2forms_digital_signature\Service\SigningService
88
arguments:
99
- '@http_client'
10+
- '@datetime.time'
1011
- '@config.factory'
1112
- '@entity_type.manager'
1213
- '@logger.channel.os2forms_digital_signature'

modules/os2forms_digital_signature/src/Service/SigningService.php

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

33
namespace Drupal\os2forms_digital_signature\Service;
44

5+
use Drupal\Component\Datetime\TimeInterface;
56
use Drupal\Core\Config\ConfigFactoryInterface;
67
use Drupal\Core\Config\ImmutableConfig;
78
use Drupal\Core\Entity\EntityStorageInterface;
@@ -39,6 +40,7 @@ class SigningService {
3940

4041
public function __construct(
4142
private readonly ClientInterface $httpClient,
43+
private readonly TimeInterface $time,
4244
ConfigFactoryInterface $configFactory,
4345
EntityTypeManager $entityTypeManager,
4446
private readonly LoggerChannelInterface $logger,
@@ -184,7 +186,7 @@ public function deleteStalledSubmissions() : void {
184186
$digitalSignatureWebforms = [];
185187

186188
// Finding webforms that have any handler.
187-
$query = \Drupal::entityQuery('webform')
189+
$query = $this->webformStorage->getQuery()
188190
->exists('handlers');
189191
$handler_webform_ids = $query->execute();
190192

@@ -217,7 +219,7 @@ public function deleteStalledSubmissions() : void {
217219

218220
// Find all stalled webform submissions of digital signature forms.
219221
$retention_period = ($this->config->get('os2forms_digital_signature_submission_retention_period')) ?? 300;
220-
$timestamp_threshold = \Drupal::time()->getRequestTime() - $retention_period;
222+
$timestamp_threshold = $this->time->getRequestTime() - $retention_period;
221223
$query = $this->webformSubmissionStorage->getQuery()
222224
->accessCheck(FALSE)
223225
->condition('webform_id', $digitalSignatureWebforms, 'IN')

0 commit comments

Comments
 (0)