lib/Util/IdentityUtils.php
public static function normalizeIdentities($identities)
    {
        if (is_array($identities)) {
            $identities = array_map([__CLASS__, 'normalizeIdentity'], $identities);
        }

        if (null === $identities) {
            return [];
        }

        if (is_string($identities)) {
            $identities = [self::normalizeIdentity($identities)];
        }

        if (!is_array($identities) && $identities instanceof IdentityInterface) {
            $identities = [$identities];
        }

        return $identities;
    }
public static function normalizeIdentities($identities)
    {
        if (is_array($identities)) {
            $identities = array_map([__CLASS__, 'normalizeIdentity'], $identities);
        }

        if (null === $identities) {
            return [];
        }

        if (is_string($identities)) {
            $identities = [self::normalizeIdentity($identities)];
        }

        if (!is_array($identities) && $identities instanceof IdentityInterface) {
            $identities = [$identities];
        }

        return $identities;
    }
@param IdentityInterface[]|string $identities

@return IdentityInterface[]