Skip to content

Commit c3fe1b1

Browse files
committed
Cleaned up
1 parent 69aa181 commit c3fe1b1

6 files changed

Lines changed: 23 additions & 6 deletions

File tree

src/Drush/Commands/ValidateXmlCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Drupal\os2forms_fordelingskomponent\Drush\Commands;
66

7-
use Composer\Console\Input\InputOption;
87
use Drupal\Core\Entity\EntityTypeManagerInterface;
98
use Drupal\Core\Url;
109
use Drupal\os2forms_fordelingskomponent\Helper\FordelingskomponentHelper;
@@ -18,6 +17,7 @@
1817
use Symfony\Component\Console\Exception\InvalidArgumentException;
1918
use Symfony\Component\Console\Input\InputArgument;
2019
use Symfony\Component\Console\Input\InputInterface;
20+
use Symfony\Component\Console\Input\InputOption;
2121
use Symfony\Component\Console\Output\OutputInterface;
2222
use Symfony\Component\Console\Style\SymfonyStyle;
2323

src/Helper/FordelingskomponentHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ public function checkFilesDelivered(
507507
}
508508
catch (\Exception $exception) {
509509
$this->logger->warning('Error checking file %filename: %message', $context + [
510-
'%filename' => $filename ?? NULL,
510+
'%filename' => $filename,
511511
'%message' => $exception->getMessage(),
512512
'exception' => $exception,
513513
]);

src/Helper/WebformHelperSF2900.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,13 @@ public function renderPreview(WebformHandlerSF2900 $handler, WebformSubmissionIn
127127
$distributionObject = NULL;
128128
$xml = new XmlRenderResult(
129129
template: '',
130-
context: [],
130+
context: [
131+
'submission' => [],
132+
'files' => [],
133+
'handler' => [
134+
'settings' => [],
135+
],
136+
],
131137
rendered: NULL,
132138
exception: NULL,
133139
);

src/Helper/XmlHelper.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,16 @@ public function render(string $template, array $context, bool $validateXml = TRU
7575

7676
/**
7777
* Get render context.
78+
*
79+
* @return array {
80+
* submission: array,
81+
* files: array,
82+
* handler: array{
83+
* settings: array
84+
* }
85+
* }
7886
*/
79-
public function getRenderContext(HandlerSettings $handlerSettings, WebformSubmissionInterface $submission, array $files) {
87+
public function getRenderContext(HandlerSettings $handlerSettings, WebformSubmissionInterface $submission, array $files): array {
8088
return [
8189
'submission' => $submission->toArray(TRUE),
8290
'files' => $files,

src/Model/XmlRenderResult.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ public function __construct(
1818
* The context.
1919
*
2020
* @var array{
21-
* submission: array,
21+
* submission: array|WebformSubmissionInterface|null,
2222
* files: array,
23-
* handler: array,
23+
* handler: array{
24+
* settings: array,
25+
* },
2426
* }
2527
*/
2628
public array $context,

src/Os2formsFordelingskomponentTwigExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ final class Os2formsFordelingskomponentTwigExtension extends AbstractExtension {
1515
/**
1616
* {@inheritdoc}
1717
*/
18+
#[\Override]
1819
public function getFunctions(): array {
1920
$functions[] = new TwigFunction(
2021
'os2forms_fordelingskomponent_intval',

0 commit comments

Comments
 (0)