Skip to content

Commit

Permalink
Use Webmozart for assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed May 28, 2019
1 parent 0a150fe commit 3cf36dd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/Auth/Source/SQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace SimpleSAML\Module\sqlauth\Auth\Source;

use Webmozart\Assert\Assert;

/**
* Simple SQL authentication source
*
Expand Down Expand Up @@ -48,8 +50,8 @@ class SQL extends \SimpleSAML\Module\core\Auth\UserPassBase
*/
public function __construct($info, $config)
{
assert(is_array($info));
assert(is_array($config));
Assert::isArray($info);
Assert::isArray($config);

// Call the parent constructor first, as required by the interface
parent::__construct($info, $config);
Expand Down Expand Up @@ -129,8 +131,8 @@ private function connect()
*/
protected function login($username, $password)
{
assert(is_string($username));
assert(is_string($password));
Assert::string($username);
Assert::string($password);

$db = $this->connect();

Expand Down

0 comments on commit 3cf36dd

Please sign in to comment.