22
33namespace SimpleSAML \Module \ldap \Auth \Process ;
44
5+ use Webmozart \Assert \Assert ;
6+
57/**
68 * Does a reverse membership lookup on the logged in user,
79 * looking for groups it is a member of and adds them to
@@ -24,8 +26,8 @@ class AttributeAddUsersGroups extends BaseFilter
2426 */
2527 public function process (&$ request )
2628 {
27- assert ( is_array ( $ request) );
28- assert ( array_key_exists ( 'Attributes ' , $ request ) );
29+ Assert:: isArray ( $ request );
30+ Assert:: keyExists ( $ request , 'Attributes ' );
2931
3032 // Log the process
3133 \SimpleSAML \Logger::debug (
@@ -226,10 +228,8 @@ protected function getGroupsActiveDirectory($attributes)
226228 * @param array $memberof
227229 * @return array
228230 */
229- protected function search ($ memberof )
231+ protected function search (array $ memberof )
230232 {
231- assert (is_array ($ memberof ));
232-
233233 // Used to determine what DN's have already been searched
234234 static $ searched = [];
235235
@@ -306,7 +306,7 @@ protected function search($memberof)
306306 */
307307 protected function searchActiveDirectory ($ dn )
308308 {
309- assert ( is_string ( $ dn) && $ dn != '' );
309+ Assert:: stringNotEmpty ( $ dn );
310310
311311 // Shorten the variable name
312312 $ map = &$ this ->attribute_map ;
0 commit comments