Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.

Commit 8cd30fe

Browse files
author
Dominik Frantisek Bucik
committed
refactor: 💡 Simplify FQN in warning-test-sp-tpl
Replace long names with shorter form and use import instead
1 parent 540afac commit 8cd30fe

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

templates/warning-test-sp-tpl.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php declare(strict_types=1);
22

33
use SimpleSAML\Module;
4+
use SimpleSAML\Module\perun\Auth\Process\WarningTestSP;
45
use SimpleSAML\XHTML\Template;
56

67
/**
@@ -11,13 +12,13 @@
1112
* @var Template $this
1213
*/
1314

14-
$customHeaderEnabled = isset($this->data[Module\perun\Auth\Process\WarningTestSP::CUSTOM_HEADER_ENABLED])
15-
&& $this->data[Module\perun\Auth\Process\WarningTestSP::CUSTOM_HEADER_ENABLED];
16-
$customTextEnabled = isset($this->data[Module\perun\Auth\Process\WarningTestSP::CUSTOM_TEXT_ENABLED])
17-
&& $this->data[Module\perun\Auth\Process\WarningTestSP::CUSTOM_TEXT_ENABLED];
15+
$customHeaderEnabled = isset($this->data[WarningTestSP::CUSTOM_HEADER_ENABLED])
16+
&& $this->data[WarningTestSP::CUSTOM_HEADER_ENABLED];
17+
$customTextEnabled = isset($this->data[WarningTestSP::CUSTOM_TEXT_ENABLED])
18+
&& $this->data[WarningTestSP::CUSTOM_TEXT_ENABLED];
1819

1920
$this->data['header'] = $customTextEnabled ?
20-
$this->t(Module\perun\Auth\Process\WarningTestSP::CUSTOM_HEADER_KEY) :
21+
$this->t(WarningTestSP::CUSTOM_HEADER_KEY) :
2122
$this->t('{perun:perun:warning-test-sp-tpl_text}');
2223

2324
$this->includeAtTemplateBase('includes/header.php');
@@ -27,7 +28,7 @@
2728
<input type="hidden" name="StateId" value="<?php echo $_REQUEST['StateId'] ?>">
2829
<?php
2930
if ($customTextEnabled) {
30-
echo '<div>' . $this->t(Module\perun\Auth\Process\WarningTestSP::CUSTOM_TEXT_KEY) . '</div>' . PHP_EOL;
31+
echo '<div>' . $this->t(WarningTestSP::CUSTOM_TEXT_KEY) . '</div>' . PHP_EOL;
3132
}
3233
?>
3334
<br/>

0 commit comments

Comments
 (0)