File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33namespace SimpleSAML \Module \authcrypt \Auth \Source ;
44
5+ use Webmozart \Assert \Assert ;
6+
57/**
68 * Authentication source for username & hashed password.
79 *
@@ -31,8 +33,8 @@ class Hash extends \SimpleSAML\Module\core\Auth\UserPassBase
3133 */
3234 public function __construct ($ info , $ config )
3335 {
34- assert ( is_array ( $ info) );
35- assert ( is_array ( $ config) );
36+ Assert:: isArray ( $ info );
37+ Assert:: isArray ( $ config );
3638
3739 // Call the parent constructor first, as required by the interface
3840 parent ::__construct ($ info , $ config );
@@ -85,8 +87,8 @@ public function __construct($info, $config)
8587 */
8688 protected function login ($ username , $ password )
8789 {
88- assert ( is_string ( $ username) );
89- assert ( is_string ( $ password) );
90+ Assert:: string ( $ username );
91+ Assert:: string ( $ password );
9092
9193 foreach ($ this ->users as $ userpass => $ attrs ) {
9294 $ matches = explode (': ' , $ userpass , 2 );
Original file line number Diff line number Diff line change 99 * @package SimpleSAMLphp
1010 */
1111
12+ use Webmozart \Assert \Assert ;
1213use WhiteHat101 \Crypt \APR1_MD5 ;
1314
1415class Htpasswd extends \SimpleSAML \Module \core \Auth \UserPassBase
@@ -38,8 +39,9 @@ class Htpasswd extends \SimpleSAML\Module\core\Auth\UserPassBase
3839 */
3940 public function __construct ($ info , $ config )
4041 {
41- assert (is_array ($ info ));
42- assert (is_array ($ config ));
42+
43+ Assert::isArray ($ info );
44+ Assert::isArray ($ config );
4345
4446 // Call the parent constructor first, as required by the interface
4547 parent ::__construct ($ info , $ config );
@@ -79,8 +81,8 @@ public function __construct($info, $config)
7981 */
8082 protected function login ($ username , $ password )
8183 {
82- assert ( is_string ( $ username) );
83- assert ( is_string ( $ password) );
84+ Assert:: string ( $ username );
85+ Assert:: string ( $ password );
8486
8587 foreach ($ this ->users as $ userpass ) {
8688 $ matches = explode (': ' , $ userpass , 2 );
You can’t perform that action at this time.
0 commit comments