Fixes a count() php warning without an api change

Warning: count(): Parameter must be an array or an object that implements Countable in /path/to/vendor/silverstripe/framework/src/Security/Member.php on line 1355
This commit is contained in:
azt3k 2018-04-27 17:14:57 +12:00 committed by Daniel Hensby
parent e7abf11225
commit 6b39b25e20
No known key found for this signature in database
GPG Key ID: D8DEBC4C8E7BC8B9

View File

@ -1347,6 +1347,12 @@ class Member extends DataObject
*/
public static function mapInCMSGroups($groups = null)
{
// non-countable $groups will issue a warning when using count() in PHP 7.2+
if (!$groups) {
$groups = [];
}
// Check CMS module exists
if (!class_exists(LeftAndMain::class)) {
return ArrayList::create()->map();