Skip to content

Commit 3cf36dd

Browse files
committed
Use Webmozart for assertions
1 parent 0a150fe commit 3cf36dd

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

lib/Auth/Source/SQL.php

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

33
namespace SimpleSAML\Module\sqlauth\Auth\Source;
44

5+
use Webmozart\Assert\Assert;
6+
57
/**
68
* Simple SQL authentication source
79
*
@@ -48,8 +50,8 @@ class SQL extends \SimpleSAML\Module\core\Auth\UserPassBase
4850
*/
4951
public function __construct($info, $config)
5052
{
51-
assert(is_array($info));
52-
assert(is_array($config));
53+
Assert::isArray($info);
54+
Assert::isArray($config);
5355

5456
// Call the parent constructor first, as required by the interface
5557
parent::__construct($info, $config);
@@ -129,8 +131,8 @@ private function connect()
129131
*/
130132
protected function login($username, $password)
131133
{
132-
assert(is_string($username));
133-
assert(is_string($password));
134+
Assert::string($username);
135+
Assert::string($password);
134136

135137
$db = $this->connect();
136138

0 commit comments

Comments
 (0)