The expression $user_row of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an
empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or !empty(...) instead.

Loading history...

169

3

return null;

170

}

171

172

3

$user = call_user_func($this->_callable_get_user, $user_row->guid);

173

3

return $user ? $user : null;

174

}

175

176

/**

177

* Store a hash in the DB

178

*

179

* @param \ElggUser $user The user for whom we're storing the hash

180

* @param string $hash The hashed token

181

*

182

* @return void

183

*/

184

3

protected function storeHash(\ElggUser $user, $hash) {

185

// This prevents inserting the same hash twice, which seems to be happening in some rare cases

186

// and for unknown reasons. See https://github.com/Elgg/Elgg/issues/8104