Skip to content

Commit

Permalink
Merge pull request #200 from silinternational/feature/fix-type-errors
Browse files Browse the repository at this point in the history
fix type errors for two different login scenarios
  • Loading branch information
briskt authored May 30, 2024
2 parents 6f20c17 + f454b8b commit 3386802
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions modules/expirychecker/lib/Auth/Process/ExpiryDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ protected function getAttribute($attributeName, $state)
* expire.
* @return int The number of days remaining
*/
protected function getDaysLeftBeforeExpiry($expiryTimestamp)
protected function getDaysLeftBeforeExpiry($expiryTimestamp): int
{
$now = time();
$end = $expiryTimestamp;
Expand Down Expand Up @@ -389,7 +389,7 @@ protected function redirectToWarningPage(&$state, $accountName, $expiryTimestamp
]));

$daysLeft = $this->getDaysLeftBeforeExpiry($expiryTimestamp);
$state['daysLeft'] = $daysLeft;
$state['daysLeft'] = (string)$daysLeft;

if (isset($state['isPassive']) && $state['isPassive'] === true) {
/* We have a passive request. Skip the warning. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<p class="mdl-typography--title margin">
<?php
$daysLeft = $this->data['daysLeft'] ?? 0;
$daysLeft = $this->data['daysLeft'] ?? '0';
$expiringMessage = $daysLeft < 2 ?
$this->t('{material:about2expire:expiring_in_a_day}') :
$this->t('{material:about2expire:expiring_soon}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<div class="mdl-card__title center" >
<p class="mdl-card__subtitle-text">
<?= $this->t('{material:mfa:running_out_info}', ['{numBackupCodesRemaining}' => (string)(int)$this->data['numBackupCodesRemaining']]) ?>
<?= $this->t('{material:mfa:running_out_info}', ['{numBackupCodesRemaining}' => $this->data['numBackupCodesRemaining']]) ?>
</p>
</div>

Expand Down

0 comments on commit 3386802

Please sign in to comment.