Code Duplication    Length = 4-4 lines in 2 locations

lib/UserModel.php 2 locations

@@ 25-28 (lines=4) @@
22
	{
23
		if (!$key)
24
		{
25
			if (empty($properties[User::PASSWORD_HASH]))
26
			{
27
				$properties[User::PASSWORD_HASH] = User::hash_password(uniqid(true));
28
			}
29
30
			if (empty($properties[User::CREATED_AT]) || DateTime::from($properties[User::CREATED_AT])->is_empty)
31
			{
@@ 40-43 (lines=4) @@
37
		# If defined, the password is encrypted before we pass it to our super class.
38
		#
39
40
		if (!empty($properties[User::PASSWORD]))
41
		{
42
			$properties[User::PASSWORD_HASH] = User::hash_password($properties[User::PASSWORD]);
43
		}
44
45
		$rc = parent::save($properties, $key, $options);
46