Skip to content

Commit dd338d4

Browse files
committed
Use Webmozart for assertions
1 parent e99377b commit dd338d4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/Auth/Process/ExpiryDate.php

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

33
namespace SimpleSAML\Module\expirycheck\Auth\Process;
44

5+
use Webmozart\Assert\Assert;
6+
57
/**
68
* Filter which show "about to expire" warning or deny access if netid is expired.
79
*
@@ -46,7 +48,7 @@ public function __construct(&$config, $reserved)
4648
{
4749
parent::__construct($config, $reserved);
4850

49-
assert(is_array($config));
51+
Assert::isArray($config);
5052

5153
if (array_key_exists('warndaysbefore', $config)) {
5254
$this->warndaysbefore = $config['warndaysbefore'];
@@ -140,7 +142,7 @@ public function process(&$state)
140142
$expireOnDate = strtotime($state['Attributes'][$this->expirydate_attr][0]);
141143

142144
if ($this->shWarning($state, $expireOnDate, $this->warndaysbefore)) {
143-
assert(is_array($state));
145+
Assert::isArray($state);
144146
if (isset($state['isPassive']) && $state['isPassive'] === true) {
145147
// We have a passive request. Skip the warning.
146148
return;

0 commit comments

Comments
 (0)